From: Bryam Vargas <hexlabsecurity@proton.me>
To: netdev-bot+sashiko@kernel.org, Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@kernel.org>,
"David S . Miller" <davem@davemloft.net>,
Alexandra Winter <wintera@linux.ibm.com>,
Thorsten Winkler <twinkler@linux.ibm.com>
Cc: Simon Horman <horms@kernel.org>,
Hidayath Khan <hidayath@linux.ibm.com>,
Nagamani PV <nagamani@linux.ibm.com>,
linux-s390@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 2/2] net/iucv: do not count the SHT frame against the receive window
Date: Thu, 29 Oct 2026 04:18:08 +0000 [thread overview]
Message-ID: <20261029041801.406712-1-hexlabsecurity@proton.me> (raw)
In-Reply-To: <179306942509.3134.1109951482403010755@kernel.org>
On Tue, 27 Oct 2026 02:50:25 +0000, netdev-bot+sashiko@kernel.org wrote:
> [Severity: High]
> Can an empty frame read after the over-window close reach
> iucv_send_ctrl() while iucv->hs_dev is NULL?
Yes. The close purges backlog_skb_q, not sk_receive_queue, msg_recv
stays over the limit, and with the length test an empty frame read
after it skips the -EFAULT branch and lands in the window update. Repro
on the emulated s390x setup with SO_MSGLIMIT 2: the peer sends twice
(the window), then from a tap on its interface one data frame over the
window, its SHUT_WR for the SHT, and 16 more data frames behind it, so
backlog_skb_q is not empty and no read sends a window update before
the close (a Linux peer blocks at the window; the overrun is injected).
Six reads: 1, 1, -EFAULT (the close), -ECONNRESET, 0 (the SHT),
-EFAULT (a data frame behind the SHT closes again). On v1 the fifth
read enters iucv_send_ctrl() once, with nothing leaving the adapter.
The reads are the same with and without the bug: on a default boot the
NULL read lands in the lowcore and afiucv_hs_send() fails with -ENODEV,
as you say, so nothing shows from user space. v2 sends the update only
while the socket is connected; the same run then shows no attempt
after the close.
> [Severity: Medium]
> This is a pre-existing issue, but does a zero-length data frame always
> arrive at the receiver as an empty data frame?
No. With a credit piggybacked it is a window update to afiucv_hs_rcv()
and never reaches recvmsg(). v2 narrows the sentence to "a zero-length
data frame that reaches recvmsg()". The slot the sender loses there is
the tx side's own accounting, not this patch's.
> [Severity: Medium]
> This is a pre-existing issue, but the classic IUCV transport still has a
> WARN that a peer can trigger, of the same kind as the one removed here.
Same kind, agreed, and iucv_process_message_q() retries the oversize
message on every read. That is the z/VM transport, not this path; out
of scope here.
> [Severity: High]
> This isn't a bug introduced by this patch, but this read-time check is
> the only window enforcement on the receive side. Can a peer that ignores
> its window grow iucv->backlog_skb_q without limit?
Today it can: nothing on arrival counts against the window, and
backlog_skb_q is neither bounded nor charged. This patch takes a WARN
off that check and does not move the enforcement; the bound belongs on
the rx side at arrival and is not this patch's.
> [Severity: Medium]
> This is a pre-existing issue, but can a conforming peer still reach this
> close?
Yes, by lowering SO_MSGLIMIT in IUCV_BOUND below the window the SYN
advertised; that is the case in the notes below the patch. Not in the
commit message or the comment: 2/2 only stops counting the SHT and
takes the WARN off, and the socket enforcing a window other than the
one it advertised is the series' fix. The locking series keeps the
advertised window in its own field, so the budget, this check and the
update threshold read the same number.
> [Severity: Low]
> Two unsynchronized writes to sk->sk_shutdown can lose RCV_SHUTDOWN.
Pre-existing; the series puts both writes under the same lock.
Thanks,
Bryam
pw-bot: cr
prev parent reply other threads:[~2026-10-29 4:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 2:48 [PATCH net 0/2] net/iucv: two fixes in the HiperSockets receive path Bryam Vargas via B4 Relay
2026-10-23 2:48 ` [PATCH net 1/2] net/iucv: clear hs_dev before dropping its reference Bryam Vargas via B4 Relay
2026-10-23 2:53 ` sashiko-bot
2026-10-27 2:50 ` netdev-bot+sashiko
2026-10-29 4:17 ` Bryam Vargas
2026-10-23 2:48 ` [PATCH net 2/2] net/iucv: do not count the SHT frame against the receive window Bryam Vargas via B4 Relay
2026-10-23 2:53 ` sashiko-bot
2026-10-27 2:50 ` netdev-bot+sashiko
2026-10-29 4:18 ` Bryam Vargas [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=20261029041801.406712-1-hexlabsecurity@proton.me \
--to=hexlabsecurity@proton.me \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--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=nagamani@linux.ibm.com \
--cc=netdev-bot+sashiko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=twinkler@linux.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