net/smc: fix TCP fallback socket release
authorMyungho Jung <mhjungk@gmail.com>
Tue, 18 Dec 2018 17:02:25 +0000 (09:02 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jan 2019 16:14:46 +0000 (17:14 +0100)
commit952dea5bc0b43bd26412455f32651f34f8e7ccff
treea0059b248c706ee7bc66691db1af842cdad910e9
parent256e0b8a98a9fc541c3920c4e91a545bd2158f56
net/smc: fix TCP fallback socket release

[ Upstream commit 78abe3d0dfad196959b1246003366e2610775ea6 ]

clcsock can be released while kernel_accept() references it in TCP
listen worker. Also, clcsock needs to wake up before released if TCP
fallback is used and the clcsock is blocked by accept. Add a lock to
safely release clcsock and call kernel_sock_shutdown() to wake up
clcsock from accept in smc_release().

Reported-by: syzbot+0bf2e01269f1274b4b03@syzkaller.appspotmail.com
Reported-by: syzbot+e3132895630f957306bc@syzkaller.appspotmail.com
Signed-off-by: Myungho Jung <mhjungk@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/smc/af_smc.c
net/smc/smc.h