From: Dust Li <dust.li@linux.alibaba.com>
To: hexlabsecurity@proton.me, "D. Wythe" <alibuda@linux.alibaba.com>,
Mahanta Jambigi <mjambigi@linux.ibm.com>,
Sidraya Jayagond <sidraya@linux.ibm.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@kernel.org>
Cc: linux-s390@vger.kernel.org, Wen Gu <guwen@linux.alibaba.com>,
linux-rdma@vger.kernel.org, Tony Lu <tonylu@linux.alibaba.com>,
Wenjia Zhang <wenjia@linux.ibm.com>,
netdev@vger.kernel.org, Stefan Raspl <raspl@linux.ibm.com>,
Hidayath Khan <hidayath@linux.ibm.com>,
Simon Horman <horms@kernel.org>,
Ursula Braun <ubraun@linux.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2] net/smc: don't spin in smc_rx_recvmsg() while a pipe holds spliced data
Date: Thu, 5 Nov 2026 01:00:03 +0800 [thread overview]
Message-ID: <autkkxC260Mq--dx@linux.alibaba.com> (raw)
In-Reply-To: <20261029-b4-disp-da7f8e6a-v2-1-9052904adf72@proton.me>
On 2026-10-29 03:03:33, Bryam Vargas via B4 Relay wrote:
>From: Bryam Vargas <hexlabsecurity@proton.me>
>
>While bytes spliced off the RMB are still in a pipe, recvmsg() waits
>for the pipe to release them before it copies the data behind them.
>The path to that wait skips the timeout and signal checks, and
>smc_rx_wait() returns at once on RCV_SHUTDOWN. With a signal pending,
>after SHUT_RD, or once the peer closes or shuts down writing,
>recvmsg() spins on a CPU until the pipe is drained, and SIGKILL cannot
>stop it. MSG_DONTWAIT and an expired SO_RCVTIMEO wait there too
>instead of returning -EAGAIN.
>
>Check the timeout and signals before that wait, and end it when the
>pipe releases the data or the connection is killed, not on RCV_SHUTDOWN.
>A zero-length read returns 0 without waiting for the pipe; a
>non-blocking one returns -EAGAIN while poll() still reports the socket
>readable (splice() can still take those bytes). The wait sets
>SOCKWQ_ASYNC_WAITDATA like smc_rx_wait(), so a byte arriving behind
>the pipe raises no SIGIO on a reader already asleep for it, and a full
>barrier orders its wait queue entry before its read of splice_pending,
>so no wake is lost.
>
>Fixes: 9014db202cb7 ("smc: add support for splice()")
>Cc: stable@vger.kernel.org
>Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
Reviewed-by: Dust Li <dust.li@linux.alibaba.com>
Best regards,
Dust
prev parent reply other threads:[~2026-11-04 17:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 8:03 Bryam Vargas via B4 Relay
2026-10-29 8:06 ` netdev-bot+sinfo
2026-11-03 14:18 ` Paolo Abeni
2026-11-04 16:56 ` Dust Li
2026-11-04 17:00 ` Dust Li [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=autkkxC260Mq--dx@linux.alibaba.com \
--to=dust.li@linux.alibaba.com \
--cc=alibuda@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=guwen@linux.alibaba.com \
--cc=hexlabsecurity@proton.me \
--cc=hidayath@linux.ibm.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mjambigi@linux.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=raspl@linux.ibm.com \
--cc=sidraya@linux.ibm.com \
--cc=tonylu@linux.alibaba.com \
--cc=ubraun@linux.ibm.com \
--cc=wenjia@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
all inboxes | Powered by JetHome®