net/smc: fix TCP fallback socket release
authorMyungho Jung <mhjungk@gmail.com>
Tue, 18 Dec 2018 17:02:25 +0000 (09:02 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Dec 2018 06:02:51 +0000 (22:02 -0800)
commit78abe3d0dfad196959b1246003366e2610775ea6
tree101f58d43375ea186240109dbb123854a006dade
parentf7db2beb4c2c6cc8111f5ab90fc7363ca91107b6
net/smc: fix TCP fallback socket release

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>
net/smc/af_smc.c
net/smc/smc.h