From: Alexandra Winter <wintera@linux.ibm.com>
To: hexlabsecurity@proton.me, Paolo Abeni <pabeni@redhat.com>,
Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Thorsten Winkler <twinkler@linux.ibm.com>,
Eric Dumazet <edumazet@google.com>
Cc: Aswin Karuvally <aswin@linux.ibm.com>,
netdev@vger.kernel.org, Simon Horman <horms@kernel.org>,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
Hidayath Khan <hidayath@linux.ibm.com>
Subject: Re: [PATCH net v3] net/iucv: fix the recvmsg window update
Date: Mon, 31 Aug 2026 17:08:54 +0200 [thread overview]
Message-ID: <e6473c2f-1c17-4dca-90a5-9cac8baf6f90@linux.ibm.com> (raw)
In-Reply-To: <20260828-b4-disp-33fac0ed-v3-1-e6d061880ee0@proton.me>
On 28.08.26 21:07, Bryam Vargas via B4 Relay wrote:
> From: Bryam Vargas <hexlabsecurity@proton.me>
>
> iucv_sock_recvmsg() sends the HiperSockets-only AF_IUCV_FLAG_WIN without
> testing the transport, so on a classic z/VM socket iucv_send_ctrl() sizes
> the skb through a NULL iucv->hs_dev. SO_MSGLIMIT accepts 1, so msglimit / 2
> is zero and one recvmsg() on its own socket is enough for an unprivileged
> process to take a spurious disconnect.
>
> It also calls iucv_send_ctrl() under spin_lock_bh(&message_q.lock), which
> allocates GFP_KERNEL inside a section the code treats as atomic. Sending
> outside that lock lets two recvmsg() reach afiucv_hs_send() at once, where
> msg_recv is sampled for the advertised window and subtracted after
> dev_queue_xmit() -- and sendmsg reaches that counter under lock_sock()
> while recvmsg holds no socket lock, so both can subtract the same value,
> the counter goes negative and the credit reaches the peer twice.
>
> Test the transport, claim the credit with atomic_xchg() after the last
> error exit and hand it back if the transmit fails, and send once the lock
> is dropped.
>
> Fixes: 3881ac441f64 ("af_iucv: add HiperSockets transport")
^^^ This is the older commit and should be used as Fixes-Tag
(alloc under spin lock and HiperSockets send in a z/VM scenario)> Fixes: 238965b71b96 ("net/af_iucv: build proper skbs for HiperTransport")
^^^
This is a newer commit and add the skb build consequence described above.
I think it needs to be drpped as Fixes tag.
I don't think you can have 2 Fixes tags, can you?
> Cc: stable@vger.kernel.org
> Tested-by: Aswin Karuvally <aswin@linux.ibm.com>
> Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
> ---
> v3: squashed the three v2 patches into one, as Alexandra Winter asked -- they
> are one subject (iucv->msg_recv handling), they had a stated dependency,
> and one patch is easier to backport. No code change from v2 1-3 combined.
>
> The v2 1/3 changelog said the NULL read faults under relocate_lowcore.
> That is out: Alexandra booted with it and did not hit a page fault. I have
> no explanation to offer in its place: vmem.c:521-524 skips the first
> sizeof(struct lowcore) bytes from the identity mapping whether or not the
> lowcore was relocated. So the changelog now claims only the disconnect,
> which she reproduced.
>
> Tested-by carried from v2: the code is identical to v2 1-3 applied in
> order.
>
> v2: https://lore.kernel.org/all/20260821-b4-disp-3a6e8695-v2-0-37597ff723a8@proton.me/
> v1: https://lore.kernel.org/all/20260815-b4-disp-8a791503-v1-0-fbae9a511144@proton.me/
>
> Not reproduced here: CONFIG_AFIUCV depends on S390 and I have no Z. The
> counter race was checked under LKMM -- the counter reaches -2 before the
> atomic_xchg() and cannot after -- and the tree builds clean for s390.
> ---
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
netdev maintainers, feel free to remove the second Fixes tag.
(Re-tested on s390)
>
prev parent reply other threads:[~2026-08-31 15:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 19:07 [PATCH net v3] net/iucv: fix the recvmsg window update Bryam Vargas via B4 Relay
2026-08-29 19:07 ` sashiko-bot
2026-08-31 15:08 ` Alexandra Winter [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=e6473c2f-1c17-4dca-90a5-9cac8baf6f90@linux.ibm.com \
--to=wintera@linux.ibm.com \
--cc=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 \
/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