linux-brain/net/netrom
Cong Wang f14b4a6267 netrom: hold sock when setting skb->destructor
[ Upstream commit 4638faac03 ]

sock_efree() releases the sock refcnt, if we don't hold this refcnt
when setting skb->destructor to it, the refcnt would not be balanced.
This leads to several bug reports from syzbot.

I have checked other users of sock_efree(), all of them hold the
sock refcnt.

Fixes: c8c8218ec5 ("netrom: fix a memory leak in nr_rx_frame()")
Reported-and-tested-by: <syzbot+622bdabb128acc33427d@syzkaller.appspotmail.com>
Reported-and-tested-by: <syzbot+6eaef7158b19e3fec3a0@syzkaller.appspotmail.com>
Reported-and-tested-by: <syzbot+9399c158fcc09b21d0d2@syzkaller.appspotmail.com>
Reported-and-tested-by: <syzbot+a34e5f3d0300163f0c87@syzkaller.appspotmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
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-07-31 07:28:46 +02:00
..
af_netrom.c netrom: hold sock when setting skb->destructor 2019-07-31 07:28:46 +02:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
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 include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
nr_out.c netrom: use linux/uaccess.h 2014-10-17 23:52:54 -04:00
nr_route.c net, netrom: convert nr_node.refcount from atomic_t to refcount_t 2017-07-04 22:35:17 +01:00
nr_subr.c netrom: use linux/uaccess.h 2014-10-17 23:52:54 -04:00
nr_timer.c netrom: switch to sock timer API 2019-02-06 17:31:32 +01:00
sysctl_net_netrom.c net: Convert uses of typedef ctl_table to struct ctl_table 2013-06-13 02:36:09 -07:00