From: Aswin Karuvally <aswin@linux.ibm.com>
To: hexlabsecurity@proton.me, Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
Alexandra Winter <wintera@linux.ibm.com>,
Thorsten Winkler <twinkler@linux.ibm.com>,
"David S. Miller" <davem@davemloft.net>
Cc: Hidayath Khan <hidayath@linux.ibm.com>,
Simon Horman <horms@kernel.org>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-s390@vger.kernel.org,
Ursula Braun <ursula.braun@de.ibm.com>
Subject: Re: [PATCH net v2 0/3] net/iucv: fix the recvmsg window update
Date: Tue, 25 Aug 2026 18:47:55 +0530 [thread overview]
Message-ID: <f34135fd-ff30-4e9d-84ed-cf4cedbbcd78@linux.ibm.com> (raw)
In-Reply-To: <20260821-b4-disp-3a6e8695-v2-0-37597ff723a8@proton.me>
On 21/08/26 16:47, Bryam Vargas via B4 Relay wrote:
> v2 answers Jakub's reviews of v1 with changes rather than replies.
>
> 1/3 keeps its hunk and states the impact properly. SO_MSGLIMIT accepts 1,
> which makes msglimit / 2 zero, and msg_recv never leaves zero on a classic
> socket, so the NULL read is one recvmsg() away for an unprivileged process
> on a socket of its own. With relocate_lowcore it faults.
>
> Its Fixes: tag was wrong as well. The unconditional send does date to
> 3881ac441f64, but iucv_send_ctrl() sized the skb with a constant ETH_HLEN
> until 238965b71b96, so before that it just returned -ENODEV. Backport
> window is v5.3, not v3.1.
>
> 2/3 is new. v1 admitted it widened the msg_recv race and left it open,
> which isn't good enough under Cc: stable. afiucv_hs_send() samples the
> counter and settles it after dev_queue_xmit(); sendmsg reaches that under
> lock_sock() and recvmsg reaches it under no socket lock, so the two don't
> exclude each other and both can subtract the same value. Negative counter,
> WARN_ON, and the same credit advertised twice to a peer whose
> afiucv_hs_callback_win() subtracts the wire value from msg_sent unchecked.
>
> Taking the socket lock around the deferred send would close it too, since
> recvmsg is the only unlocked side. I didn't: recvmsg has never held that
> lock, and making it do so changes the receive path for every caller. That
> belongs in the locking rework, not in a stable fix.
>
> The claim sits after the last error exit rather than in the header build,
> so the counter reads zero only while the transmit is in flight, and a
> concurrent sender isn't talked out of its own update.
>
> 3/3 is v1's patch, and it must not be applied without 2/3: hoisting the
> send out of message_q.lock drops the serialisation that lock gave two
> concurrent recvmsg(). Backported alone it recreates what 2/3 fixes. Both
> changelogs say so.
>
> Litmus test under LKMM: the counter reaches -2 before 2/3 and cannot after.
> No hardware run; I have no IBM Z, and CONFIG_AFIUCV is s390-only.
>
> The unlocked hs_dev and sk_shutdown window, the unbounded backlog_skb_q and
> the WARN_ON a flooding peer can reach are pre-existing and wider than this
> series. They belong with the locking rework Alexandra has open.
>
> Thanks for the reviews.
>
> ---
> Bryam Vargas (3):
> net/iucv: only send the window update on HiperSockets sockets
> net/iucv: claim the receive credit atomically
> net/iucv: send the window update outside message_q.lock
>
> net/iucv/af_iucv.c | 42 +++++++++++++++++++++++++-----------------
> 1 file changed, 25 insertions(+), 17 deletions(-)
> ---
> base-commit: 746fc0787f616da418ffc04a110296fe95d53491
> change-id: 20260821-b4-disp-3a6e8695-c1f4a6069169
>
> Best regards,
> --
> Bryam Vargas <hexlabsecurity@proton.me>
Thank you for the fixes Bryam!
Tested-by: Aswin Karuvally <aswin@linux.ibm.com>
prev parent reply other threads:[~2026-08-25 13:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 11:17 [PATCH net v2 0/3] net/iucv: fix the recvmsg window update Bryam Vargas via B4 Relay
2026-08-21 11:17 ` [PATCH net v2 1/3] net/iucv: only send the window update on HiperSockets sockets Bryam Vargas via B4 Relay
2026-08-22 11:17 ` sashiko-bot
2026-08-21 11:17 ` [PATCH net v2 2/3] net/iucv: claim the receive credit atomically Bryam Vargas via B4 Relay
2026-08-22 11:17 ` sashiko-bot
2026-08-21 11:17 ` [PATCH net v2 3/3] net/iucv: send the window update outside message_q.lock Bryam Vargas via B4 Relay
2026-08-22 11:17 ` sashiko-bot
2026-08-24 12:58 ` Alexandra Winter
2026-08-24 13:08 ` [PATCH net v2 0/3] net/iucv: fix the recvmsg window update Alexandra Winter
2026-08-25 13:17 ` Aswin Karuvally [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=f34135fd-ff30-4e9d-84ed-cf4cedbbcd78@linux.ibm.com \
--to=aswin@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.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-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=twinkler@linux.ibm.com \
--cc=ursula.braun@de.ibm.com \
--cc=wintera@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