Netdev List
 help / color / mirror / Atom feed
* [PATCH 6.6.y] rxrpc: Fix the ACK parser to extract the SACK table for parsing
       [not found] <2026061543-superior-passerby-d597@gregkh>
@ 2026-06-17 18:04 ` Sasha Levin
  2026-06-17 20:27   ` Jakub Kicinski
  0 siblings, 1 reply; 4+ messages in thread
From: Sasha Levin @ 2026-06-17 18:04 UTC (permalink / raw)
  To: stable
  Cc: David Howells, Michael Bommarito, Marc Dionne, Jeffrey Altman,
	Eric Dumazet, David S. Miller, Jakub Kicinski, Paolo Abeni,
	Simon Horman, linux-afs, netdev, stable, Sasha Levin

From: David Howells <dhowells@redhat.com>

[ Upstream commit 333b6d5bb9f87827ac2639c737bf9613dbae7253 ]

Fix modification of the received skbuff in rxrpc_input_soft_acks() and a
potential incorrect access of the buffer in a fragmented UDP packet (the
packet would probably have to be deliberately pre-generated as fragmented)
when AF_RXRPC tries to extract the contents of the SACK table by copying
out the contents of the SACK table into a buffer before attempting to parse

AF_RXRPC assumes that it can just call skb_condense() and then validly
access the SACK table from skb->data and that it will be a flat buffer -
but skb_condense() can silently fail to do anything under some
circumstances.

Note that whilst rxrpc_input_soft_acks() should be able to parse extended
ACKs, the rest of AF_RXRPC doesn't currently support that.

Further, there's then no need to call skb_condense() in rxrpc_input_ack(),
so don't.

Fixes: d57a3a151660 ("rxrpc: Save last ACK's SACK table rather than marking txbufs")
Reported-by: Michael Bommarito <michael.bommarito@gmail.com>
Link: https://lore.kernel.org/r/20260513180907.2061972-1-michael.bommarito@gmail.com
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Jeffrey Altman <jaltman@auristor.com>
cc: Eric Dumazet <edumazet@google.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: Simon Horman <horms@kernel.org>
cc: linux-afs@lists.infradead.org
cc: netdev@vger.kernel.org
cc: stable@kernel.org
Link: https://patch.msgid.link/105362.1780573560@warthog.procyon.org.uk
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/rxrpc/input.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c
index 9a162035d4c1d0..1157bf75ef9c8c 100644
--- a/net/rxrpc/input.c
+++ b/net/rxrpc/input.c
@@ -781,7 +781,18 @@ static void rxrpc_input_soft_acks(struct rxrpc_call *call,
 	struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
 	unsigned int i, old_nacks = 0;
 	rxrpc_seq_t lowest_nak = seq + sp->nr_acks;
-	u8 *acks = skb->data + sizeof(struct rxrpc_wire_header) + sizeof(struct rxrpc_ackpacket);
+	u8 sack[256] __aligned(sizeof(unsigned long));
+	u8 *acks = sack;
+
+	/* Extract the SACK table into a flat buffer rather than accessing it
+	 * directly through skb->data, which is not guaranteed to be linear for
+	 * a fragmented packet (skb_condense() can silently fail to linearise
+	 * it).
+	 */
+	if (skb_copy_bits(skb,
+			  sizeof(struct rxrpc_wire_header) + sizeof(struct rxrpc_ackpacket),
+			  sack, umin(sp->nr_acks, sizeof(sack))) < 0)
+		return;
 
 	for (i = 0; i < sp->nr_acks; i++) {
 		if (acks[i] == RXRPC_ACK_TYPE_ACK) {
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 6.6.y] rxrpc: Fix the ACK parser to extract the SACK table for parsing
  2026-06-17 18:04 ` [PATCH 6.6.y] rxrpc: Fix the ACK parser to extract the SACK table for parsing Sasha Levin
@ 2026-06-17 20:27   ` Jakub Kicinski
  2026-06-17 21:52     ` Sasha Levin
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2026-06-17 20:27 UTC (permalink / raw)
  To: Sasha Levin
  Cc: stable, David Howells, Michael Bommarito, Marc Dionne,
	Jeffrey Altman, Eric Dumazet, David S. Miller, Paolo Abeni,
	Simon Horman, linux-afs, netdev, stable

On Wed, 17 Jun 2026 14:04:10 -0400 Sasha Levin wrote:
> Subject: [PATCH 6.6.y] rxrpc: Fix the ACK parser to extract the SACK table for parsing
> Date: Wed, 17 Jun 2026 14:04:10 -0400
> X-Mailer: git-send-email 2.53.0
> 
> From: David Howells <dhowells@redhat.com>
> 
> [ Upstream commit 333b6d5bb9f87827ac2639c737bf9613dbae7253 ]

nit: you missed the "skip patchwork" header on this?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 6.6.y] rxrpc: Fix the ACK parser to extract the SACK table for parsing
  2026-06-17 20:27   ` Jakub Kicinski
@ 2026-06-17 21:52     ` Sasha Levin
  2026-06-17 22:05       ` Jakub Kicinski
  0 siblings, 1 reply; 4+ messages in thread
From: Sasha Levin @ 2026-06-17 21:52 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: stable, David Howells, Michael Bommarito, Marc Dionne,
	Jeffrey Altman, Eric Dumazet, David S. Miller, Paolo Abeni,
	Simon Horman, linux-afs, netdev, stable

On Wed, Jun 17, 2026 at 01:27:04PM -0700, Jakub Kicinski wrote:
>On Wed, 17 Jun 2026 14:04:10 -0400 Sasha Levin wrote:
>> Subject: [PATCH 6.6.y] rxrpc: Fix the ACK parser to extract the SACK table for parsing
>> Date: Wed, 17 Jun 2026 14:04:10 -0400
>> X-Mailer: git-send-email 2.53.0
>>
>> From: David Howells <dhowells@redhat.com>
>>
>> [ Upstream commit 333b6d5bb9f87827ac2639c737bf9613dbae7253 ]
>
>nit: you missed the "skip patchwork" header on this?

Hey Jakub,

This one is a backport crafted in response to a failed backport of a stable
tagged commit.

I followed Greg's template to sending those backports to him, but I also think
that I do want folks to review the actual backport itself.

Do you think it makes sense to add a skip patchwork header on these too?

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 6.6.y] rxrpc: Fix the ACK parser to extract the SACK table for parsing
  2026-06-17 21:52     ` Sasha Levin
@ 2026-06-17 22:05       ` Jakub Kicinski
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2026-06-17 22:05 UTC (permalink / raw)
  To: Sasha Levin
  Cc: stable, David Howells, Michael Bommarito, Marc Dionne,
	Jeffrey Altman, Eric Dumazet, David S. Miller, Paolo Abeni,
	Simon Horman, linux-afs, netdev, stable

On Wed, 17 Jun 2026 17:52:24 -0400 Sasha Levin wrote:
> On Wed, Jun 17, 2026 at 01:27:04PM -0700, Jakub Kicinski wrote:
> >On Wed, 17 Jun 2026 14:04:10 -0400 Sasha Levin wrote:  
> >> Subject: [PATCH 6.6.y] rxrpc: Fix the ACK parser to extract the SACK table for parsing
> >> Date: Wed, 17 Jun 2026 14:04:10 -0400
> >> X-Mailer: git-send-email 2.53.0
> >>
> >> From: David Howells <dhowells@redhat.com>
> >>
> >> [ Upstream commit 333b6d5bb9f87827ac2639c737bf9613dbae7253 ]  
> >
> >nit: you missed the "skip patchwork" header on this?  
> 
> Hey Jakub,
> 
> This one is a backport crafted in response to a failed backport of a stable
> tagged commit.
> 
> I followed Greg's template to sending those backports to him, but I also think
> that I do want folks to review the actual backport itself.

I see!
 
> Do you think it makes sense to add a skip patchwork header on these too?

Hm, maybe some clever patchwork DB query would tell us what others do.
For networking the patchwork queue is purely for patches we have to
apply. So my preference would be to skip, but I didn't realize this
was intentional. 

It'd still be useful to add _some_ header that we could filter on. 
We have bots which complain if people repost patches too fast,
they will get confused.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-17 22:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <2026061543-superior-passerby-d597@gregkh>
2026-06-17 18:04 ` [PATCH 6.6.y] rxrpc: Fix the ACK parser to extract the SACK table for parsing Sasha Levin
2026-06-17 20:27   ` Jakub Kicinski
2026-06-17 21:52     ` Sasha Levin
2026-06-17 22:05       ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox