All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 1/1] net/smc: keep clcsock reference in smc_tcp_listen_work()
@ 2018-04-25 10:48 Ursula Braun
  2018-04-25 18:38 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Ursula Braun @ 2018-04-25 10:48 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, raspl, ubraun

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 3d502067599f ("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: 127f49705823 ("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
---
 net/smc/af_smc.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index f5d4b69dbabc..4470501374bf 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -978,10 +978,6 @@ static void smc_tcp_listen_work(struct work_struct *work)
 	}
 
 out:
-	if (lsmc->clcsock) {
-		sock_release(lsmc->clcsock);
-		lsmc->clcsock = NULL;
-	}
 	release_sock(lsk);
 	sock_put(&lsmc->sk); /* sock_hold in smc_listen */
 }
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net 1/1] net/smc: keep clcsock reference in smc_tcp_listen_work()
  2018-04-25 10:48 [PATCH net 1/1] net/smc: keep clcsock reference in smc_tcp_listen_work() Ursula Braun
@ 2018-04-25 18:38 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-04-25 18:38 UTC (permalink / raw)
  To: ubraun; +Cc: netdev, linux-s390, schwidefsky, heiko.carstens, raspl, ubraun

From: Ursula Braun <ubraun@linux.ibm.com>
Date: Wed, 25 Apr 2018 12:48:58 +0200

> 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 3d502067599f ("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: 127f49705823 ("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

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-25 18:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-25 10:48 [PATCH net 1/1] net/smc: keep clcsock reference in smc_tcp_listen_work() Ursula Braun
2018-04-25 18:38 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.