Skip to content

Commit 070204a

Browse files
Ursula Braundavem330
authored andcommitted
net/smc: keep clcsock reference in smc_tcp_listen_work()
The internal CLC socket should exist till the SMC-socket is released. Function tcp_listen_worker() releases the internal CLC socket of a listen socket, if an smc_close_active() is called. This function is called for the final release(), but it is called for shutdown SHUT_RDWR as well. This opens a door for protection faults, if socket calls using the internal CLC socket are called for a shutdown listen socket. With the changes of commit 3d50206 ("net/smc: simplify wait when closing listen socket") there is no need anymore to release the internal CLC socket in function tcp_listen_worker((). It is sufficient to release it in smc_release(). Fixes: 127f497 ("net/smc: release clcsock from tcp_listen_worker") Signed-off-by: Ursula Braun <ubraun@linux.ibm.com> Reported-by: syzbot+9045fc589fcd196ef522@syzkaller.appspotmail.com Reported-by: syzbot+28a2c86cf19c81d871fa@syzkaller.appspotmail.com Reported-by: syzbot+9605e6cace1b5efd4a0a@syzkaller.appspotmail.com Reported-by: syzbot+cf9012c597c8379d535c@syzkaller.appspotmail.com Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 02a6efc commit 070204a

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

net/smc/af_smc.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -978,10 +978,6 @@ static void smc_tcp_listen_work(struct work_struct *work)
978978
}
979979

980980
out:
981-
if (lsmc->clcsock) {
982-
sock_release(lsmc->clcsock);
983-
lsmc->clcsock = NULL;
984-
}
985981
release_sock(lsk);
986982
sock_put(&lsmc->sk); /* sock_hold in smc_listen */
987983
}

0 commit comments

Comments
 (0)