From: Alexandra Winter <wintera@linux.ibm.com>
To: hexlabsecurity@proton.me, Paolo Abeni <pabeni@redhat.com>,
"David S. Miller" <davem@davemloft.net>,
Hidayath Khan <hidayath@linux.ibm.com>,
Willem de Bruijn <willemb@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Eric Dumazet <edumazet@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Nagamani PV <nagamani@linux.ibm.com>,
linux-s390@vger.kernel.org, Simon Horman <horms@kernel.org>,
Thorsten Winkler <twinkler@linux.ibm.com>
Subject: Re: [PATCH RFC net v5 01/10] net/iucv: record that a HiperSockets socket sent its SYN
Date: Fri, 4 Dec 2026 19:58:05 +0100 [thread overview]
Message-ID: <02be7607-a3f9-4f99-a1ee-85a000939ec4@linux.ibm.com> (raw)
In-Reply-To: <20261203-b4-disp-8029c32d-v5-1-0bce531e20d0@proton.me>
On 04.12.26 04:02, Bryam Vargas via B4 Relay wrote:
> From: Bryam Vargas <hexlabsecurity@proton.me>
>
> A HiperSockets socket is IUCV_BOUND from bind() until the SYN|ACK
> arrives, with or without a SYN on its way, and nothing tells the two
> apart:
Maybe sth like this is even clearer?:
..until the SYN|ACK arrives. The sk_state is the same whether or not a
SYN has already been sent. This leads to the following problems:
No strong feeling, but as this is still an RFC...
>
> - SO_MSGLIMIT is accepted after the SYN carried msglimit to the peer as
> the receive window, while recvmsg() counts the frames it reads against
> the new value. When the limit is lowered, a peer that keeps to its
> window has the socket closed on it once the receive buffer is full and
> frames wait in backlog_skb_q: WARN_ON(), -EFAULT, the rest of the
> stream lost. When it is raised far enough, no window update is sent
> and the peer's writer waits for one that only a data frame from us
> would carry.
> - A later connect() sends another SYN: one restarted after a signal, or
> one that follows a non-blocking or timed-out connect(). The listener
> makes a second child with the same names.
> - A SYN|ACK or SYN|FIN is accepted by a socket that sent no SYN.
>
> Record that the SYN was handed to the device. From then on SO_MSGLIMIT
> fails with -EINVAL, as on a connected socket, and connect() sends no
> other SYN: it waits for the reply to the first, or fails with -EALREADY
> if it names another peer. A SYN|ACK or SYN|FIN for a socket that sent no
> SYN is dropped. A SYN that was not sent records nothing.
>
> Fixes: 3881ac441f64 ("af_iucv: add HiperSockets transport")
> Fixes: 800c5eb7b5eb ("af_iucv: change net_device handling for HS transport")
> Suggested-by: Alexandra Winter <wintera@linux.ibm.com>
> Cc: stable@vger.kernel.org # 6.18.x
> Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
> ---
I tested the "SO_MSGLIMIT after connect()" issues and the both went away
with this fix.
I also reproduced the "Second SYN after non-blocking connect()", and it
also went away with this fix.
Tested-by: Alexandra Winter <wintera@linux.ibm.com>
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
next prev parent reply other threads:[~2026-12-04 18:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 3:02 [PATCH RFC net v5 00/10] net/iucv: serialize the HiperSockets receive path with the socket lock Bryam Vargas via B4 Relay
2026-12-04 3:02 ` [PATCH RFC net v5 01/10] net/iucv: record that a HiperSockets socket sent its SYN Bryam Vargas via B4 Relay
2026-12-04 18:58 ` Alexandra Winter [this message]
2026-12-04 3:02 ` [PATCH RFC net v5 02/10] net/iucv: do not clear SEND_SHUTDOWN to send a control frame Bryam Vargas via B4 Relay
2026-12-04 3:02 ` [PATCH RFC net v5 03/10] net/iucv: fail sendmsg() with EPIPE once sending is shut down Bryam Vargas via B4 Relay
2026-12-04 3:02 ` [PATCH RFC net v5 04/10] net/iucv: run recvmsg() under the socket lock Bryam Vargas via B4 Relay
2026-12-04 3:02 ` [PATCH RFC net v5 05/10] net/iucv: factor out the HiperSockets frame dispatch and state changes Bryam Vargas via B4 Relay
2026-12-04 3:02 ` [PATCH RFC net v5 06/10] net/iucv: serialize HiperSockets receive with the socket lock Bryam Vargas via B4 Relay
2026-12-04 3:02 ` [PATCH RFC net v5 07/10] net/iucv: set RCV_SHUTDOWN under the socket spinlock Bryam Vargas via B4 Relay
2026-12-04 3:02 ` [PATCH RFC net v5 08/10] net/iucv: return EOF to a reader parked when the peer closes Bryam Vargas via B4 Relay
2026-12-04 3:02 ` [PATCH RFC net v5 09/10] net/iucv: decrement pendings when a pending frame's transmit fails Bryam Vargas via B4 Relay
2026-12-04 3:02 ` [PATCH RFC net v5 10/10] net/iucv: forget a SYN that the device reports unreachable Bryam Vargas via B4 Relay
2026-12-04 11:05 ` [PATCH RFC net v5 00/10] net/iucv: serialize the HiperSockets receive path with the socket lock Hidayath Khan
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=02be7607-a3f9-4f99-a1ee-85a000939ec4@linux.ibm.com \
--to=wintera@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--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=nagamani@linux.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=twinkler@linux.ibm.com \
--cc=willemb@google.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