From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796437249; b=tqOG6Mr+wraWj2Zixsj8IbS0EFATYGDXvVfYFZRDFaqywsu29IFfJw4HEpeWnw+l4M9D HJn2vGIRZvy9n06iKjYq6RSnDkXmeMc4i6MaDuXkERgr+VgZTiUqP+msmUMc/dupY7Bat n+1fm3KMAnnwoK5YLKc/dsU1HXbEhF44w4dvFPVTjop7afY9Tobq7TR09q+AD5m4MhCxW OJ6q4L05tYoBQuPGzNrRqhGt3jWvE3AVXBgwwsl6KK98ecMWk9EWaW6ALfLOxbFSEU7lI bdXgtCYBXd/X/0fh1QNfSm5DrDiFw7vY3rQPU2jj6Hr1Qo/ZzmjtlAGS8NSBFDuAZ8w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796437249; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=R08xlIwOx4kSkxXKCD/22de/7E5HTXdJFelSZu1KLWw=; b=Tg2J4UzPANK+DWZCVNXkn1MwZjaJ+BbiSIKEdLh/aTYZAI0fCiPGxg9s6r5KX88QDYmZ Beokl72tzAvN1YPg+r3ojuMnBsj7h7dPYwk1NZTRs1n42bVBgHNU1feuQMp2dwdtTRkMm xnUZqUDgUyibjO5hSXVKJgIHkn5txpNYH9mfrc9woAi/TOW+CLJWopuW/Euewm0aALu7T S6aRzhTY2fZwok0KZxuVDD6J3K+z+Gy/qofR4QJ5yFaXLnFlsFM4EdKBeRDBHT9apUDEc pYBfmvWvAj+ByKS/5cR0agU4ht17rHXvJ+umC7HEt+To/POVvcq33OwFdR9gthrUvLA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=T0L9v66L; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B95D7606A32F; Sat, 5 Dec 2026 02:20:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=T0L9v66L Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18DC81F00936; Sat, 5 Dec 2026 02:20:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796437249; bh=R08xlIwOx4kSkxXKCD/22de/7E5HTXdJFelSZu1KLWw=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=T0L9v66Lqfc52wtDKBQAgnGS2dv9Zz0N1439fU0mh9WbNqDVhtUt1TqaZG6DgAzWB YwNBK8/gIFYnWd5FEt7ffczmq3ofjUZj2WP+iHjoCvEqw3rn6ss6DE7CyGTTFN9iVd tupK8Fmd5xigahJ4GyEJJlL/Z2VaOn7BOcaDkWKNtFT+JgWWiiC4bPOHJ3gYyuuIv0 gimfejCKtOjZI/iNtip0SXLvq/LTzq48MIyqYjWOhvafa7nElVyPNEiYkASU0TpEtP l3Wdn28dDErAA/xcykwnlKeDJ3vjWtrb9/QiucF+eY/rb7bZKRzrNQZERtBJbgg6Bc 1suSNrFm9LXcQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net v4] net/smc: serialize clcsock release against CDC receive path Reply-To: sashiko-reviews@lists.linux.dev To: "Qican Ma" Cc: linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org, "Heiko Carstens" , "Vasily Gorbik" , "Alexander Gordeev" , "Christian Borntraeger" In-Reply-To: <179635082914.26472.6075133370101625319@gmail.com> References: <179635082914.26472.6075133370101625319@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 02:20:48 +0000 X-Mailing-List: linux-s390@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] net/smc: redundant and ineffective conn->freed guard in smc_tx_is_corked() -- commit 496edff7fbb2f3dcea39d11cf640ad5d5b6ccbac Author: Qican Ma net/smc: serialize clcsock release against CDC receive path This commit frees the SMC connection before releasing clcsock in __smc_release(), guards smc_cdc_msg_recv() and smc_tx_is_corked() on conn->freed, and annotates conn->freed accesses with READ_ONCE() and WRITE_ONCE(). [ ... ] > diff --git a/net/smc/smc_tx.c b/net/smc/smc_tx.c > index 386d172c57528..04baccad21f5d 100644 > --- a/net/smc/smc_tx.c > +++ b/net/smc/smc_tx.c > @@ -126,8 +126,12 @@ static int smc_tx_wait(struct smc_sock *smc, int fla= gs) > =20 > static bool smc_tx_is_corked(struct smc_sock *smc) > { > - struct tcp_sock *tp =3D tcp_sk(smc->clcsock->sk); > + struct tcp_sock *tp; > =20 > + if (smc->conn.freed || !smc->clcsock) > + return true; > + > + tp =3D tcp_sk(smc->clcsock->sk); > return (tp->nonagle & TCP_NAGLE_CORK) ? true : false; > } [Severity: Low] Can smc_tx_is_corked() ever observe conn->freed or a NULL smc->clcsock? Its only call chain is smc_sendmsg() -> smc_tx_sendmsg() -> smc_tx_should_cork() -> smc_tx_is_corked() under lock_sock(sk). smc_sendmsg() rejects SMC_CLOSED and smc_tx_wait() rechecks teardown after reacquiring lock_sock(sk), while teardown sets SMC_CLOSED under lock_sock(). Even if it were reachable, returning true here does not prevent RDMA writes as the commit message states. smc_tx_should_cork() gates smc_tx_is_corked() on atomic_read(&conn->sndbuf_space), so when a send fills the buffer, smc_tx_sndbuf_nonempty() still runs after conn->sndbuf_desc was already use= d. The commit message also states that both writer and reader of smc->clcsock run under lock_sock(), but smc_clcsock_release() clears and frees smc->clcsock under clcsock_release_lock after release_sock(sk). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/179635082914.26472.= 6075133370101625319@gmail.com?part=3D1