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:38:32 +0000 (17:38 +0100)
commite028017380f03abbb79df182469df5b9fffeb58a
tree168f1afa0d60ff193941f254d15b0a4f12cc0a18
parenta1bce7196b726f1578f7558af6f13c25157181e4
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