🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26695

[PATCH RFC net v5 09/10] net/iucv: decrement pendings when a pending frame's transmit fails

#26695
From: Bryam Vargas via B4 Relay
Date: Fri, 04 Dec 2026 03:02
80 lines
14097 bytes
From: Bryam Vargas <hexlabsecurity@proton.me>

When the HiperSockets device keeps a frame for later, qeth reports it as
TX_NOTIFY_PENDING and af_iucv counts it in iucv->pendings: sendmsg()
sends nothing while that count is above zero. Only TX_NOTIFY_DELAYED_OK
takes the count down. When the device ends such a frame with an error,
the count stays up. On a connected socket, that changes nothing, since
the error disconnects it. When the frame is a SYN, the socket stays
IUCV_BOUND and a later connect() can still connect it. For as long as it
is connected, sendmsg() returns -EAGAIN, at once or after the send
timeout, or blocks if there is no timeout, and poll() does not report
EPOLLOUT.

Take the count down for the two delayed error notifications as well.
A pending frame that qeth gives up on when it drains its queues is
reported as TX_NOTIFY_GENERALERROR, like a frame that was never
pending, and is still not counted down.

Fixes: 3881ac441f64 ("af_iucv: add HiperSockets transport")
Fixes: 800c5eb7b5eb ("af_iucv: change net_device handling for HS transport")
Cc: stable@vger.kernel.org # 6.18.x
Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me>
---
v5: new. The bug was found while reviewing 10/10, which makes it
reachable again; net has it too. The patch applies to net without the
rest of the series.

Emulated setup. The adapter is told to report the SYN as pending and to
end it later with an error, so that qeth gives TX_NOTIFY_PENDING and
then the delayed notification. The first connect() times out. The peer
is listening the whole time. After the second connect() the socket
sends one byte, with a send timeout of 1 s:

- pending, then unreachable (completion code 16). net: the second
  connect() returns 0 and send() returns -EAGAIN; the count is still 1.
  net with this patch alone: the byte arrives. With 1/10 to 8/10, and
  with 1/10 to 9/10, the second connect() sends no SYN and returns
  -EAGAIN. With the series the byte arrives. With the series but
  without this patch, send() returns -EAGAIN again
- pending, then another error (completion code 1). net: send() returns
  -EAGAIN. net with this patch alone: the byte arrives. With only the
  TX_NOTIFY_DELAYED_UNREACHABLE label of this patch: -EAGAIN again.
  With the series the second connect() sends no SYN: 10/10 forgets a
  SYN only when it is reported unreachable

I can't tell whether a real device reports a SYN as pending and then
fails it. If it does not, the patch changes nothing that can be seen:
on a connected socket the error disconnects it, and the count is not
read again.

Not fixed: when qeth drains its pending buffers it reports them with
TX_NOTIFY_GENERALERROR, the same as a frame that was never pending, so
af_iucv cannot take the count down there. Tested with a device recovery
(1 written to its recover attribute) while the SYN is pending: on net,
with or without this patch, the second connect() returns 0 and send()
returns -EAGAIN.
---
 net/iucv/af_iucv.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index 8336f7056d49..1f1f6f698648 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -2725,6 +2725,11 @@ static void afiucv_hs_callback_txnotify(struct sock *sk, enum iucv_tx_notify n)
 		if (atomic_dec_return(&iucv->pendings) <= 0)
 			iucv_sock_wake_msglim(sk);
 		break;
+	case TX_NOTIFY_DELAYED_UNREACHABLE:
+	case TX_NOTIFY_DELAYED_GENERALERROR:
+		/* counted when the device reported the frame as pending */
+		atomic_dec(&iucv->pendings);
+		fallthrough;
 	default:
 		atomic_dec(&iucv->skbs_in_xmit);
 		if (sk->sk_state == IUCV_CONNECTED) {

-- 
2.56.1
Technical Details
Message-ID: <20261203-b4-disp-8029c32d-v5-9-0bce531e20d0@proton.me>
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377012-linux-kernel-netdev=dewy.ru
References: <20261203-b4-disp-8029c32d-v5-0-0bce531e20d0@proton.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377012-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 v5 09/10] net/iucv: decrement pendings when a
 pending frame's transmit fails
Date: Thu, 03 Dec 2026 22:02:21 -0500
Organization: Usenet Network
Message-ID: <20261203-b4-disp-8029c32d-v5-9-0bce531e20d0@proton.me>
References: <20261203-b4-disp-8029c32d-v5-0-0bce531e20d0@proton.me>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="2661342"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:qCbU65+KqNaLXusKURPunYeHMPI= sha256:CUk044Pgg1gdzJlyw36/daOBePyib5xGaDCDtNnmSx4=
	sha1:3Rv1J2itchSWvqM8Ei6Y4zCyju0= sha256:XbJOIXfvP6zr82CCYOrKYcRC9EULkkR7UamX3hoq/N4=
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 8CA25117AD1; Fri,  4 Dec 2026 06:02:57 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.74
X-Spam-Status: No, score=-3.74 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.24, 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 ULb8zUFlJ7IY;
	Fri,  4 Dec 2026 06:02:55 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-377012-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 4DD21117AB3; Fri,  4 Dec 2026 06:02:47 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 6E08D240F0; Fri,  4 Dec 2026 03:02:36 +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=1796353340;
	b=ECj7yL4DB7/C+E+Ug79dizUNxgX6u/RdJ5osWe0BrXWJwSlm+7o3BX4QDwyf/ky3OkzY
	 S1eyCDBkLJEzGSZT0Ax8M2XAqL5TiEyN5jhjq1BAItciBkLpQu9f9IEiNyhlF+UcEtnxP
	 S/oNd8AAqTSO8dxtSg9bvPnG4QKVsVRf77MK5NrIECc9+f76hVsUKV5jvuntYxCmaBicY
	 CuZj35EwbmI2R6G8gx83nwc6RgjhL3tjc4BQqGuJLl+8Udp0EJyiq8T5ZoykquE1irj4E
	 B9V9AWXF3/wzO+by5XrJyPltty3Pl9ifDRVjRhRbTdHWmYC9y+Sc74T86V4zkRHd5aw==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796353340;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:From:Date:
	 Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
	 X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To:Content-Transfer-Encoding;
	bh=Qo4zUDG6qTGieK4bYHNgpnJdH/BI+xMDMuFY+q1VUEA=;
	b=vQz3COzj3a4/u2Nu18sfEH3l1p5ruP2b63joLksjZBYkAglPrCOPom2IEFrx61eBZHgU
	 mTcjmEp6qGDOhkB2VupPRAfFgXzeqw7vdYB9w/1fQ/Ta7Yd1C1ZT7QKgzBIJ1Sg+bRSHh
	 5pFekpJc55MEwl1OiPnC7XJRvEM6Jb5Uvfv4GIU8ABonOtVwMqmMMK2X8JjBAzD4eF/10
	 bRD+zvz2de0ujfIgKe/jADEjFYyyYbSeAHso1BIGU39VpLlFLnxkHZdULq/87bUogO0mP
	 us3RneBITuZ4sQBS1v29QVN+bX4SO9EHI5AAHrFjTuISwJjQW8g9XR71VyO0JWOJVIA==
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=WO9poNhP;
	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 40B74606A32D;
	Fri,  4 Dec 2026 03:02:20 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WO9poNhP
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=1796353339;
	b=0PfStfQynAoHIaqdbVpYK6zGFFYxub7KGvCfxnAt5Qyr1U4BKpyPiw2G/+F2FaGT/KOU
	 bXMMV4OPcSRB6/KhQUH9j2HOGVJhVZ6U+DgISFhOiyW5h4KiuHcMtxIUFDwf1RJARkqeS
	 MKTcCtLda7I4yGMhvcE7XrBXYjbg0LiihSj9K5diE06hyowKAhxlqAXHmHv5vrimh/DZg
	 7qBN/P5qYXltQaGongtNeWS6E0V20fP5rsQOQDKA6+xR8XpEGeHvbxCFU/DKEgQXbyQTQ
	 ZH9G6iI1UqiJkdzRCzuuo2ZJ4bHaTPL7eFOKlCwF0U28vdXYEIsCDgc+1BngHGatxWw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796353339;
	h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version:
	 Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
	 X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To:Content-Transfer-Encoding;
	bh=Qo4zUDG6qTGieK4bYHNgpnJdH/BI+xMDMuFY+q1VUEA=;
	b=hPKeoaDl6eyk84GbNUP4sLKm8hZkshq6ofRfzAC7X1rJvctsnlA3RnL3mVo9/a4DtoDb
	 tjWVtASxasc2FoIYWvxBNg0J4n8owHcMIeleEyM3T6mzTXtEg8DgFkE2BTfWQSgZvYX/4
	 R6/REJV8Hn4YGhE7+G85shR+lFEMjclpeO5uuCJ5GtRmmgB5OR1EUQS/Io6ZphW5WWWQz
	 yfCStoNa3RH2HRP/DO0DtXv3n0GH4s5th38Jl3h71PFPtrsL1DaJ1WGokvLVkOZzzdM3y
	 V4dvTnmC8Fa9Ggwv8DJljR1ynjSzTr/MzXI2gCqrOQnln2lDZ9jqlwAgAP6Hr62jlUA==
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=WO9poNhP;
	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 5EB2160A2613;
	Fri,  4 Dec 2026 03:02:19 +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=1796353339;
	b=mvdigczQdga9kYhvzJ7oo6uMgHvYmn0AJZqeHeGaVCAPt6tO+8wnInqnjknml4ry1kKR
	 M/1JqEX5HghOThxtkmfXDuiQ/P79rNR4lcFLTjwELoymgnsjz0xvkKrZodQ5MN1lg2WRf
	 FadiTJvMVMXKaXKRE4GUUJQqm+7+RBsBIbUVoZax6vW/ADqeMyadt3idEAUEg9PF3qmmf
	 UWW5RlqVIJayl+aEdWHxtNkv2LVDeYh5Les9kQXjYCA2pGIacnlixod6bWYPITxndR4F6
	 aLW3rewNQ2OdSBe7jwmix1cMcrE7zi1eu75Tj6Lw/MNuU4Uue/3UtxbwK99ANrphTDA==
X-ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256;
	c=relaxed/relaxed; t=1796353339;
	h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type:
	 Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
	 X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To:Content-Transfer-Encoding;
	bh=Qo4zUDG6qTGieK4bYHNgpnJdH/BI+xMDMuFY+q1VUEA=;
	b=HGgJXYoOuRjEb5K0YHKCO6gVC2Bw3DczkG36Z2nbHNNhsejyhp2cox0SBGjrujHKfHMU
	 383QdrieHJPXeBEfIDg/FD66tmJorXzH0wu4RN583UrkdAeyFFDN+bIOwgNR0TykgE5hg
	 n+lwxP1bW+GKcIQOQQFPT4ZBOPND6FNnFP/NVnSCwLwK9Xjm3dqTne2eC7evmIEO5FFh4
	 VEgRWHFQi9ccRqBrzVzMlgz+b1YLmM6caiIB2zn6jVRWfMZRLRj46sEl8X3ePe/WjQBJ+
	 kDQ3lAzDJV0rOlVrm5028xMpoC7+vNfPz/7rgsiam/OW+ow7TSx4okT9WvgKUtzVcJQ==
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 21FC41F00937;
	Fri,  4 Dec 2026 03:02:17 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796353339;
	bh=Qo4zUDG6qTGieK4bYHNgpnJdH/BI+xMDMuFY+q1VUEA=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To;
	b=WO9poNhPI2CIF88TJbxIr0bsllBkBoURGxs4knkuJb6lR1k8QzO1roq7L3eqqUVpN
	 3htofulE6xhoCUBWD3o+c4P8GkIGQM2SEkEaCaxCtdSaawNkIJEj33GDnjxlgxx9o7
	 /93MNxT4erD5waXjDvTIoUFH62ZpGCdKXUPkw9vG1q8jW/hQ8Lu1UQoembkSxXhAmF
	 0mtPGYCt6NTbF5o++xl24GQv+itmbYCIoORYyM7iB6vM5zLkvOnICBBhFhM78fSPiY
	 XXk4jYI5u9qNN7aMU+duStlaitdk6n1lxWc5hKJaAYg0luZ0lhyKUVJzUWN9WBUNgy
	 geUxtAOENuR8A==
X-Received: from nexus.subspace.kernel.org (localhost [IPv6:::1])
	by lkml.kernel.org (Postfix) with ESMTP id 8F9B74D8B8;
	Fri,  4 Dec 2026 03:02:15 +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-In-Reply-To: <20261203-b4-disp-8029c32d-v5-0-0bce531e20d0@proton.me>
X-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>
X-Mailer: b4 0.15.2
X-Developer-Signature: v=1; a=ed25519-sha256; t=1796353333; l=3670;
 i=hexlabsecurity@proton.me; s=default; h=from:subject:message-id;
 bh=oYJhT4ZaM+HETNela2LY7XtWTifn8/EB3Cj11b2u/9U=;
 b=LFbL78bZ5AZ9VZl4LqubyzEk2wmhp4HRXzFUtCL4xNofRTeia3RKSfgVMCeejOCoDxmTk0TrQ
 P64ehuYWIYPAczH5uIpROBs8NHPZ6yiVjCiET+DfXC9m4mGZFWpxrYx
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