From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]:57560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752962AbeERITH (ORCPT ); Fri, 18 May 2018 04:19:07 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ursula Braun , syzbot+9045fc589fcd196ef522@syzkaller.appspotmail.com, syzbot+28a2c86cf19c81d871fa@syzkaller.appspotmail.com, syzbot+9605e6cace1b5efd4a0a@syzkaller.appspotmail.com, syzbot+cf9012c597c8379d535c@syzkaller.appspotmail.com, "David S. Miller" Subject: [PATCH 4.16 53/55] net/smc: keep clcsock reference in smc_tcp_listen_work() Date: Fri, 18 May 2018 10:15:49 +0200 Message-Id: <20180518081459.866212728@linuxfoundation.org> In-Reply-To: <20180518081457.428920292@linuxfoundation.org> References: <20180518081457.428920292@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: stable-owner@vger.kernel.org List-ID: 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ursula Braun [ Upstream commit 070204a34884110ac5e19c1e2e036fcfd033f8e3 ] 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 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 Signed-off-by: Greg Kroah-Hartman --- net/smc/af_smc.c | 4 ---- 1 file changed, 4 deletions(-) --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -973,10 +973,6 @@ static void smc_tcp_listen_work(struct w } out: - if (lsmc->clcsock) { - sock_release(lsmc->clcsock); - lsmc->clcsock = NULL; - } release_sock(lsk); sock_put(&lsmc->sk); /* sock_hold in smc_listen */ }