🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #6657

[PATCH RFC net-next v2 0/2] net/iucv: serialize the HiperSockets receive path with the socket lock

#6657
From: Bryam Vargas via B4 Relay
Date: Fri, 23 Oct 2026 03:00
105 lines
16550 bytes
v2 of stage 1 of the socket-locking rework [1], answering the reviews of
v1 [2]: Jakub's three points [3] (no forward declarations, a trimmed
commit message, and the AI review's items answered, here in the
changelog), the list's AI review [4] and Hidayath's test rounds on z/VM
[5], including his KCSAN report [6].

Changes in v2:

- a SYN|ACK, SYN|FIN or FIN that arrives while a task owns the socket is
  recorded in the socket, as bits (one SYN reply, the first to arrive,
  and a FIN), and applied in that order by the owner from release_cb(),
  not queued: v1's backlog path dropped a pfmemalloc skb, which qeth
  hands us under memory pressure, and nothing resends a control frame,
  so one queued there could be lost for good. The backlog still takes
  data frames in three cases: while the reply to our SYN is pending,
  behind frames already waiting, and a listener's SYNs, trimmed to their
  header. v1 charged deferred control frames to a budget; a stray
  control frame, a repeated SYN from a conforming peer or junk, can no
  longer push a FIN out of it (AI review)
- the data budget, the msg_recv check in recvmsg() and the window-update
  threshold read the window advertised in the SYN, kept in a new
  msglimit_adv, not the live SO_MSGLIMIT: lowering it in IUCV_BOUND no
  longer loses data (AI review, Hidayath's reproducer)
- a SYN|ACK or SYN|FIN that no socket state accepts is freed in
  afiucv_hs_rcv(), and a SYN to a socket that does not listen is refused
  there; a deferred SYN is refused when applied if the listener closed
  or its accept queue filled meanwhile
- iucv_sock_shutdown() sets sk_shutdown and purges under sk_lock.slock on
  HiperSockets: the data frame that bypasses the backlog tests
  RCV_SHUTDOWN under that lock (Hidayath, KCSAN)
- a reader parked when the peer closed gets EOF, not -ENOTCONN, and
  poll() reports EPOLLRDHUP: 1/2's wait loop returns EOF on IUCV_DISCONN
  with nothing left, which also covers the z/VM sever; 2/2, new in v2,
  sets RCV_SHUTDOWN at the FIN (Hidayath, AI review)
- no forward declaration for afiucv_hs_dispatch(); two remain, for the
  backlog and release_cb handlers referenced from the proto and
  iucv_sock_alloc(). They sit in the file's existing block of them,
  which aa5ec571b93f added to in September; if the IUCV maintainers
  would rather see the handlers moved below their users, that is fine
  by me (Jakub)
- the SHT accounting and the hs_dev ordering went to net as fixes of
  their own [7]; commit message trimmed (Jakub)

Applies on top of [7].

Tested like v1, on s390x under QEMU TCG, net-next 8df0638138d3, KASAN +
PROVE_LOCKING + DEBUG_ATOMIC_SLEEP, this time against an emulated
HiperSockets adapter under the real qeth and qdio drivers, tx completion
included, and an emulated CP for the z/VM transport. Of the 53 default
tests bare net-next fails 8 (7 with [7] applied; its 2/2 fixes one), v1
fails one (the parked reader) and this series fails none, with no KASAN
or lockdep report. Of 10 kernels each missing
one piece of it, 9 fail a test this series passes; the shutdown
spinlock's piece shows only under a probe that widens the window with
udelay(), and the one without the filter that frees stray control
frames in afiucv_hs_rcv() passes every test, told apart only by the
probe's frame count. The opt-in sets (window, strays, shutdown under
the probe, z/VM, MTTCG at HZ=100) and the details are below the --- of
1/2.

QEMU is patched too. Hidayath's table, compared with the code, showed
that TCG's s390x CPU emulation lacked things this needs; besides the
adapter, the QEMU here carries my patches for that, a large set too
specific to this setup to go to QEMU as it is. Where this setup and
Hidayath's z/VM runs disagree, the hardware is the reference.

Still open, as in v1: afiucv_hs_callback_txnotify() and the z/VM
callbacks change sk_state without checking whether a task owns the
socket, and so does afiucv_netdev_event(), whose fix Nagamani is holding
for this series [8]. backlog_skb_q stays unbounded for a peer that
ignores its window, on net-next as here; release_cb() exists now, and
Hidayath's proposal to reset the socket on an overrun from it goes on
top. The child socket leaked on afiucv_hs_callback_syn()'s refusal paths
is pre-existing; Hidayath flagged it in August [9] and his fix for it is
pending.

[1] https://lore.kernel.org/all/20260724222917.134769-1-hexlabsecurity@proton.me/
[2] https://lore.kernel.org/netdev/20261011-b4-disp-410518f4-v1-1-753bf3258292@proton.me/
[3] https://lore.kernel.org/netdev/20261019183223.49a59d6f@kernel.org/
[4] https://lore.kernel.org/netdev/179183431327.434549.446348148837850426@kernel.org/
[5] https://lore.kernel.org/netdev/51a4a40a-f34b-4d41-b049-69aa53f4dcf5@linux.ibm.com/
[6] https://lore.kernel.org/netdev/b3fea2ca-25ff-42c0-812c-f8cc6bb6667e@linux.ibm.com/
[7] https://lore.kernel.org/netdev/20261022-b4-disp-b35a9153-v1-0-d74645876195@proton.me/
[8] https://lore.kernel.org/netdev/1d9d3cc1-24fb-40e0-a4c7-6fbfbcf4dc37@linux.ibm.com/
[9] https://lore.kernel.org/netdev/5f88daf4-cd8e-4464-b132-ac45be205121@linux.ibm.com/

---
Bryam Vargas (2):
      net/iucv: serialize HiperSockets receive with the socket lock
      net/iucv: return EOF to a reader parked at the HiperSockets peer's FIN

 include/net/iucv/af_iucv.h |   5 +
 net/iucv/af_iucv.c         | 564 +++++++++++++++++++++++++++++++++++----------
 2 files changed, 444 insertions(+), 125 deletions(-)
---
base-commit: 8df0638138d3e0344fd1fb36cf2d1ca1cf5028f0
change-id: 20261022-b4-disp-1d26b87a-747c9d4b1953
prerequisite-message-id: <20261022-b4-disp-b35a9153-v1-0-d74645876195@proton.me>
prerequisite-patch-id: 5ef9b0bd1d5842e07b00218ef6ab3f8dd53431fe
prerequisite-patch-id: ff94c57f1b7a45e7bf1d178b252018fac71c6190

Best regards,
--  
Bryam Vargas <hexlabsecurity@proton.me>
Technical Details
Message-ID: <20261022-b4-disp-1d26b87a-v2-0-7ee1264d812a@proton.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350884-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350884-linux-kernel-netdev=dewy.ru
From: devnull+hexlabsecurity.proton.me@kernel.org (Bryam Vargas via B4 Relay)
Newsgroups: linux.kernel.netdev
Subject: [PATCH RFC net-next v2 0/2] net/iucv: serialize the HiperSockets
 receive path with the socket lock
Date: Thu, 22 Oct 2026 22:00:37 -0500
Organization: Usenet Network
Message-ID: <20261022-b4-disp-1d26b87a-v2-0-7ee1264d812a@proton.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="395868"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:gQCwP6rGc5rzfkAUpG2TARaM6io= sha256:zea3LCKnd0BNflsL7Z4Fbo3b9Rn5C8k+By68elgs0mE=
	sha1:A7TG63+S8oLWqva2JgnhlYDDNYo= sha256:/KAfCO3Lv3h6DAiQG413cGvhuaRGJ5s9RkZefPP8w7s=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 1B7881113C7; Fri, 23 Oct 2026 06:01:34 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.739
X-Spam-Status: No, score=-3.739 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.339, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id sXH6D1R4-BdC;
	Fri, 23 Oct 2026 06:01:29 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-350884-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 7590511117B; Fri, 23 Oct 2026 06:01:20 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 5517A27C9E; Fri, 23 Oct 2026 03:00:59 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1792724457;
	b=U22hTutlsQN/KctNc+92s1TNsKfdNET24WGB0fBj88VvBGVvEv3+vhge3z1XupD05P0B
	 ONeuNHsL1cfHVTv0y3am1vOOJp5kvdDy5JGs8AjByi4Z1gAY6VU9B/E3oZSKkxXvgC79s
	 mvRgcxwgZtHn1Isd1k70dK60j+nt2O8gLadnOESyW0jC90s77UY1ftKCPvTnUDau2vVFe
	 YvbhkAAOgf/+BPHG5o4noh/XX1l7YitNt0tRidAXCinEOh3fnoG01ZJhwH+lgOvQq/OuT
	 5AQ7tu2w8NkjIxn7YFktCHqAIqdhxK7IuP+O8e9nn1cIYC3bLS/Cy6Wu6iRdzMWPeJg==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792724457;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:From:Subject:
	 Date:Message-Id:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To:
	 Cc:X-Mailer:X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To;
	bh=y45DHdE7K9bU+C7qyX9cIBalo5nF4ICfddlJ9vXjiHY=;
	b=lYL4XYCMDpksGX7xTIOARaG+eqrxVzu8qbG5mfiGu4O2rlEL/s/tYP5cNFkRD2Ks6kJ4
	 v6vxfRzmqDd7mEJcQIV+b4QlNicFWECXU0mnLgwul2bmOduPRGuJXTk6AmiiAhORxHOOz
	 KwBLmNc4PuReYdj/bnw/VBqlb9VeG/kBeYogrG/cy+cqpvT+XrkSxBB8Wv/zSAVafxeZc
	 +SzGiynNhs3X7Ht4hGjeF3fMDvFx7b3Ciue96rjYdqtbSSgj2NMW3Wfu/trqCybv2l4mO
	 VjqI5zJVmCoqPdqCXD1b6COScjc/+R/hKpPOWVSZBav0GACSzGh0jd7e2oP5bhKQGUg==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OmWqdK7O;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 9D7B5606A31D;
	Fri, 23 Oct 2026 03:00:57 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OmWqdK7O
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1792724441;
	b=MJXyrkAIfoKmjhiB16NMQ7/NQ63bc2NEYeyZsENpl4wjj/+wYTz9ESHBPHiT1HKeXcS6
	 CO8JREVpE6byYfRCEiwqwps3pEwf2Ba4Fll5PczKk/VydtalYGlTP92tdCpQPjG1iq+/H
	 /nRrny+K1PigXEcCqRFfiI/WX0h7sJhoW8BA5Jw8zs2l++hqe9hOasLveepTl8+U5x500
	 D0aJlqDhU2Z8rxOsvt6EAjhJpRmlN+vhAKnocIMXJBEphn8xIwigWNw0WrYaAfXeljtDY
	 sa0+erj/fgDu/hf4oHVDBB2Evn7wPRkb01zSPal0w6mTqhIJvTczrpHB6uN1EcGIrKQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792724441;
	h=Received:DKIM-Signature:Received:From:Subject:Date:Message-Id:
	 MIME-Version:Content-Type:Content-Transfer-Encoding:X-B4-Tracking:
	 X-Change-ID:To:Cc:X-Mailer:X-Developer-Signature:X-Developer-Key:
	 X-Endpoint-Received:X-Original-From:Reply-To;
	bh=y45DHdE7K9bU+C7qyX9cIBalo5nF4ICfddlJ9vXjiHY=;
	b=2FHYT7kyxApAUaquuimNwH/AT5ZfM7QQspYPfYn7fCjJ/ajIoZoZDc7TSzFNAEOuIPhO
	 yyPTQUXz/19+e/vvK7GU9ctgmgtZaru2ncDFlVUZ2SBKWubawh0wfkBi/48h8jj85ef+W
	 m0KBjWK61kTmqGnAYqeOLzsywCix22csgmuYUF3KqLonZDJ1DC0hnWG8KouWxCJBB3RwN
	 Qk73qM9fyNB48JInHwgEwg59aSwKB+foNz41DwCeZdB7yZZmKkfFwXI2gAOw3ZkzJF1T3
	 6AtvlmVtB1kr/otNc/BuUb2Z/7Lw1IIuDjCC3JRqiJSmxFgRtM+na9FfvxkaHEplzGg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OmWqdK7O;
	arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47E05606A319;
	Fri, 23 Oct 2026 03:00:40 +0000 (UTC)
X-Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77
X-ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none;
	t=1792724440;
	b=ch7TNV+HbW0XnEHKK0VHhg4uR9s6pb3lgrtmPaqZg3ZQPbyEL7pbgaQYtbnADFnZn7Q/
	 MS92D4Nfjp/uQzLyYDufvw9SNIWhr5+h/QJTLSNN4BHhaGfXlsbw0pgatJf1Cgu0coRN3
	 qwXL5bGtQaOLxguPK0xsyj9nsQ7a7NEwjum4I1x5vrfHck5sC1vPEamFxAl3z2c1RZ1CX
	 opUqr4rskPA/zu8XM2WoIU7+y+axFLU3Cra8Cr5F3IyJBVigJtvDceM/ye/xKtcNrfcB2
	 MrNU3Cmdz4T99pXQAtMUeTAr3MEcYWMgbwS9CLBYkz/xA3euWFrRtkDnPLUoAFVhtVg==
X-ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256;
	c=relaxed/relaxed; t=1792724440;
	h=DKIM-Signature:Received:From:Subject:Date:Message-Id:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To:
	 Cc:X-Mailer:X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To;
	bh=y45DHdE7K9bU+C7qyX9cIBalo5nF4ICfddlJ9vXjiHY=;
	b=xMw4pQ35O3UJ18zmJDFdQDQU4n/YNXfRBszBJswNrmHDBGwCkmyjP/UnhA0hccN12E1S
	 O+qLsirqyGe2dVp664WEgyU68Dcal5oFD6txbglBhpqgKWakFoAQGyAsZNToTcjOoLZB4
	 yUVTk1FUdGENXgV7HAT23ryzPTWxwaX+uvRtxUH6Wy5H5nMs5yPxId466JSGYSwLODS12
	 /TxW9N0x+jdBjkry6eQPfw2314dboZbuCV3zZriimEZV64rNL/MP3vU2Yyw+vslraYFqm
	 M19u8IBE7JDKMUkdZME0aCy8gEjgGn2HAivZN37neaDELruskhwbUk/oWiLx+WSw/9w==
X-ARC-Authentication-Results: i=1; smtp.kernel.org; 
	arc=none smtp.remote-ip=100.80.115.77
X-Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.kernel.org (Postfix) with ESMTPS id D27471F01825;
	Fri, 23 Oct 2026 03:00:39 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792724440;
	bh=y45DHdE7K9bU+C7qyX9cIBalo5nF4ICfddlJ9vXjiHY=;
	h=From:Subject:Date:To:Cc:Reply-To;
	b=OmWqdK7OKXRrlB2D5mtH4OpL2rdgCiYGEFp6lCPYjpyhX2Tj4c2aRims44Ahjx0A8
	 QlvPJqXyfTfD1MsWjlWemvWX5qdmVihOrxl21bP8oGaZrUHdOUiodtpiku63kkaap6
	 91Dslc60Rc9Sy+Lu4VJq1NfDG5zEPcIzAt5Rx/+KWzMsmuxegkLOCGidCgiQFLYclB
	 HerWtsG3QJYJ/A51vfZB0QUWbHhIESe0IZFS/etBpX7Cacm3y5mUoEoOoPZu5KsX8z
	 NBCoiKnJBl8Z2Q1ZUJxyM5X4GjLEkGI/QmrjsfXUpbG/ZEVTRzduS1pAYwagBN0Z9h
	 9q0SRpQnbhY8w==
X-Received: from nexus.subspace.kernel.org (localhost [IPv6:::1])
	by lkml.kernel.org (Postfix) with ESMTP id 32994421C0;
	Fri, 23 Oct 2026 03:00:39 +0000 (UTC)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-B4-Tracking: v=1; b=H4sIAAAAAAAC/2WOy2rDMBBFf8XMuhOshyXZlBIo9AOyDVlI1qRVw
 bIjKSEQ8u+R0+y6vJc5584NMqVAGYbmBokuIYc51sDfGhh/bPwmDL5m4C1XrOUcnUQf8oLMc+W
 MtqilHnsvHes7ARVbEh3D9ancw+7rc+0iFYx0LXD4O8hn90tjWcUvJNHpXMfLi5soZ/scH5r3f
 9tOdLZnncALwxa9lkp2Rqv6wXZJc5njZqKPVexsJhznaQplaIw/tkoYJowXcLjfHx5N1Hv8AAA
 A
X-Change-ID: 20261022-b4-disp-1d26b87a-747c9d4b1953
X-Cc: Nagamani PV <nagamani@linux.ibm.com>, netdev@vger.kernel.org, 
 Simon Horman <horms@kernel.org>, linux-kernel@vger.kernel.org, 
 linux-s390@vger.kernel.org, Hidayath Khan <hidayath@linux.ibm.com>
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=ed25519-sha256; t=1792724438; l=5919;
 i=hexlabsecurity@proton.me; s=default; h=from:subject:message-id;
 bh=vRkzW2Uh/LRg3YuCuQWUZzq4vkYLc12PyTPaLfXFeds=;
 b=QmLHtjr+tAwN34cUn92rzFpPW+/AcYgBNd637P0oWRJrzTn8HPOe/1SXmlM/HCiacKt5KfFfj
 I8LE6n16O/mB9IspPeiaW6CZqZtRzeBd87D3TOpft4v6lDyEKJ5mR6Z
X-Developer-Key: i=hexlabsecurity@proton.me; a=ed25519;
 pk=xw1AhCtQdvuoQc+bOQIYy9o8G++cp4/VniI2G/tc3G8=
X-Endpoint-Received: by B4 Relay for hexlabsecurity@proton.me/default with
 auth_id=893
X-Original-From: Bryam Vargas <hexlabsecurity@proton.me>
X-Reply-To: hexlabsecurity@proton.me