android_kernel_oneplus_msm8998/net/netrom
Cong Wang 429b64a9eb netrom: fix locking in nr_find_socket()
[ Upstream commit 7314f5480f3e37e570104dc5e0f28823ef849e72 ]

nr_find_socket(), nr_find_peer() and nr_find_listener() lock the
sock after finding it in the global list. However, the call path
requires BH disabled for the sock lock consistently.

Actually the locking is unnecessary at this point, we can just hold
the sock refcnt to make sure it is not gone after we unlock the global
list, and lock it later only when needed.

Reported-and-tested-by: syzbot+f621cda8b7e598908efa@syzkaller.appspotmail.com
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-13 10:05:28 +01:00
..
af_netrom.c netrom: fix locking in nr_find_socket() 2019-01-13 10:05:28 +01:00
Makefile
nr_dev.c net: Kill dev_rebuild_header 2015-03-02 16:43:41 -05:00
nr_in.c netrom: use linux/uaccess.h 2014-10-17 23:52:54 -04:00
nr_loopback.c
nr_out.c netrom: use linux/uaccess.h 2014-10-17 23:52:54 -04:00
nr_route.c netfilter: Remove spurios included of netfilter.h 2015-06-18 21:14:32 +02:00
nr_subr.c netrom: use linux/uaccess.h 2014-10-17 23:52:54 -04:00
nr_timer.c netrom: use linux/uaccess.h 2014-10-17 23:52:54 -04:00
sysctl_net_netrom.c