Skip to content
Commit 2f9874a1 authored by Cong Wang's avatar Cong Wang Committed by Greg Kroah-Hartman
Browse files

netrom: hold sock when setting skb->destructor

[ Upstream commit 4638faac ]

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: c8c8218e

 ("netrom: fix a memory leak in nr_rx_frame()")
Reported-and-tested-by: default avatar <syzbot+622bdabb128acc33427d@syzkaller.appspotmail.com>
Reported-and-tested-by: default avatar <syzbot+6eaef7158b19e3fec3a0@syzkaller.appspotmail.com>
Reported-and-tested-by: default avatar <syzbot+9399c158fcc09b21d0d2@syzkaller.appspotmail.com>
Reported-and-tested-by: default avatar <syzbot+a34e5f3d0300163f0c87@syzkaller.appspotmail.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f6a961da
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment