]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net/smc: fix TCP fallback socket release
authorMyungho Jung <mhjungk@gmail.com>
Tue, 18 Dec 2018 17:02:25 +0000 (09:02 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit7ab8fdad6abad7548fa2ce1331e0ee51a0d5ebca
treef616cec70518dc378578f24be032cedb7ae0809f
parentcba35421660939c0fec0e4836b566f266369fc9a
net/smc: fix TCP fallback socket release

BugLink: https://bugs.launchpad.net/bugs/1837257
[ 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>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/smc/af_smc.c
net/smc/smc.h