From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382776; b=NNWgA+17DZpEJRAXhidlv55u3gA+G6FeELgDYOf+Ltcqp/3KEX65rqSVDNDuNzySpXSy fJtonf1PDGOG5u6CX3ztbH+6iW0/fiP96v3YKTZeExPPikLweF8QDioSf/2yOxJmE1m2o K2kD61nw+OSzBHIG6QidSlqhB4q4z25SO6mj48PkdeD5tWYp3z5UQCB8k0iQBUljzLKYl +lAXpvk98mrTdvXrYMvPXVJZ2LVtSmuvgAWqhV/+ToQM5gb1O+ahOI4GXy8vjdNVAc1tQ waFui98w0iBaUOPVc519LO3+eAQCqAA814WYgm0WMuYVB0rInITW5Q9fu5I7jOJbJIQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382776; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=2CO4n+tv61PWs2ibJ6mQ0UCS8TvFnkaS+zGKEyFMOTE=; b=Q6A2A5PH5VaqDJ49exNgsau2vc1E+UAG0r2PVvUQ6vzRDrlSqpN6nstqTC+MbTzM2sEV AL8+ZR30Yme1rmqwYCRIvBhHO4ps5PwTKfx5O4vbIBAbrk3Ud4lm0ff4F4Y2nF0UDckQ9 Dg6Vtke525Vm2KhUO3AlC41+PMG+ZQILNi16hRZlrO8EdRnBJjY/OJCli6trccfY7ZytG y9xI/yOokkZVuge9yf/untvsaJq8ZuIGShCtTfYH27rYBUXM0rSKjheLloMAwkGvSPo1Q UoDmO/Drbo/7o16gx8sXmCwDpoeAAnndsIG0//ZowyaxdMTSIA2GqBf6BjzgQB822tg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=0o2Kw3e1; arc=none smtp.remote-ip=100.103.45.18 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 42960606A32C; Fri, 4 Dec 2026 11:12:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=0o2Kw3e1 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 516911F000C2; Fri, 4 Dec 2026 11:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382775; bh=2CO4n+tv61PWs2ibJ6mQ0UCS8TvFnkaS+zGKEyFMOTE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=0o2Kw3e17Ma8AxbbSE22W8alWgrOUlWgCtEkwV/kZTPp0PFt/wzJTUszLMdDgu8eW rM8TKLzfIjQzqlIY/f/gws9c8EspJ404LCcqmP9H0W1hCNXpv8r7Ejj5xxHRiTtwWO SNqLwiU/rMfclflWYrb7M403slLOPe15dUQxoXfY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bernard Pidoux , Sasha Levin Subject: [PATCH 6.18 597/703] netrom: clear the choke flag on frames sent again Date: Fri, 4 Dec 2026 19:08:16 +0900 Message-ID: <20261204100643.629855692@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bernard Pidoux nr_send_iframe() and nr_send_nak_frame() set NR_CHOKE_FLAG in the transport header when we are busy, but never clear it. Both work on a clone of the frame kept on the ack queue, so the flag lands in the data shared with that frame and stays there. When such a frame is sent again, on T1 or after a NAK, it still carries the choke flag although we are no longer busy. The peer then stops sending to us again, until its own T4 runs out (180 s by default) or until we send something else. Set or clear the flag on every send, as is already done for N(S) and N(R). The copy that goes on the air is made by nr_route_frame() or nr_loopback_queue(), so no frame in flight shares the data. Tested on two QEMU guests (6.12.94, KASAN, lockdep) linked by KISS: A speaks NET/ROM itself and fills the receive buffer of a socket on B, B sends m1 while busy, then reads its data; m1 is sent again on T1 and after a NAK. before: m1 sent again twice, both times with the choke flag after: m1 sent again twice, without the choke flag Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Bernard Pidoux Assisted-by: Claude:claude-opus-5-5 (cherry picked from commit af2fe5949ad00457409fc61041feed48b3194896) Signed-off-by: Sasha Levin --- net/netrom/nr_out.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/net/netrom/nr_out.c b/net/netrom/nr_out.c index 1c6b4386c86b4..d692cf8278243 100644 --- a/net/netrom/nr_out.c +++ b/net/netrom/nr_out.c @@ -105,8 +105,16 @@ static void nr_send_iframe(struct sock *sk, struct sk_buff *skb) skb->data[2] = nr->vs; skb->data[3] = nr->vr; + /* + * skb is a clone: its data is shared with the frame kept on the + * ack queue, which is sent again on T1 or a NAK. Set or clear the + * choke flag on every send, so that a frame first sent while we + * were busy does not carry the flag on every later copy. + */ if (nr->condition & NR_COND_OWN_RX_BUSY) skb->data[4] |= NR_CHOKE_FLAG; + else + skb->data[4] &= ~NR_CHOKE_FLAG; nr_start_idletimer(sk); @@ -129,6 +137,8 @@ void nr_send_nak_frame(struct sock *sk) if (nr->condition & NR_COND_OWN_RX_BUSY) skbn->data[4] |= NR_CHOKE_FLAG; + else + skbn->data[4] &= ~NR_CHOKE_FLAG; nr_transmit_buffer(sk, skbn); -- 2.53.0