From: sashiko-bot@kernel.org
To: "Sidraya Jayagond" <sidraya@linux.ibm.com>
Cc: "Alexander Gordeev" <agordeev@linux.ibm.com>,
"Vasily Gorbik" <gor@linux.ibm.com>,
linux-s390@vger.kernel.org, "Heiko Carstens" <hca@linux.ibm.com>
Subject: Re: [PATCH net] net/smc: fix TOCTOU race between smc_listen_out() and listener close
Date: Tue, 04 Aug 2026 07:07:46 +0000 [thread overview]
Message-ID: <20260804070746.DB1CD1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260803070701.126339-1-sidraya@linux.ibm.com>
> smc_listen_out() reads lsmc->sk.sk_state without the listener lock,
> then acquires lock_sock_nested() only after the check passes. This
> opens a window where smc_close_active() can transition the listener
> to SMC_CLOSED, call smc_close_cleanup_listen() to drain the accept
> queue, and release the lock, all between the lockless read and the
> delayed lock acquisition:
>
> smc_listen_work (smc_hs_wq) smc_close_active()
> ------------------------------- -------------------------
> release_sock(child)
> if (sk_state == SMC_LISTEN) TRUE
> lock_sock(listener)
> sk_state = SMC_CLOSED
> smc_close_cleanup_listen()
> release_sock(listener)
> [ ... ]
> and the enqueue are atomic under the listener lock.
>
> Fixes: fd57770dd198 ("net/smc: wait for pending work before clcsock release_sock")
> Reviewed-by: Mahanta Jambigi <mjambigi@linux.ibm.com>
> Signed-off-by: Sidraya Jayagond <sidraya@linux.ibm.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260803070701.126339-1-sidraya@linux.ibm.com?part=1
prev parent reply other threads:[~2026-08-04 7:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 7:07 [PATCH net] net/smc: fix TOCTOU race between smc_listen_out() and listener close Sidraya Jayagond
2026-08-03 12:54 ` Breno Leitao
2026-08-04 7:22 ` Sidraya Jayagond
2026-08-04 8:02 ` Breno Leitao
2026-08-04 7:07 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260804070746.DB1CD1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sidraya@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox