Netdev List
 help / color / mirror / Atom feed
* [PATCH net] rxrpc: Fix max_data reduction on an oversized ICMPv6 PTB
@ 2026-12-02 18:13 Andrew Stellman
  2026-12-03 18:14 ` netdev-bot+sashiko
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Stellman @ 2026-12-02 18:13 UTC (permalink / raw)
  To: David Howells, Marc Dionne
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman, linux-afs, netdev, linux-kernel

From: Andrew Stellman <astellman@stellman-greene.com>

rxrpc_adjust_mtu() computes max_t(int, mtu - peer->hdrsize, 500) on
unsigned values, so a difference of 2^31 or more turns negative and is
floored to 500. An ICMPv6 Packet Too Big with MTU 0xfffffff0 cut a
peer's max_data from 1440 to 500. Compare the payload size as unsigned
and keep the 500 floor for MTUs at or below the header size. Oversized
PTBs no longer reduce max_data.

Fixes: eeaedc5449d9 ("rxrpc: Implement path-MTU probing using padded PING ACKs (RFC8899)")
Signed-off-by: Andrew Stellman <astellman@stellman-greene.com>
---
Tested on mainline 693c2e04e3f1 in arm64 QEMU with KASAN: an ICMPv6 PTB
with MTU 0xfffffff0 cut max_data from 1440 to 500 before the patch and
left it at 1440 after.

Found with Quality Playbook
(https://github.com/andrewstellman/quality-playbook) running Claude
Opus 5.5; the fix was drafted with OpenAI GPT-6 (Codex).

A reproducer is available on request.

 net/rxrpc/peer_event.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/rxrpc/peer_event.c b/net/rxrpc/peer_event.c
index 9d02448ac062..5e9cd4adc478 100644
--- a/net/rxrpc/peer_event.c
+++ b/net/rxrpc/peer_event.c
@@ -122,7 +122,10 @@ static void rxrpc_adjust_mtu(struct rxrpc_peer *peer, unsigned int mtu)
 		}
 	}
 
-	max_data = max_t(int, mtu - peer->hdrsize, 500);
+	if (mtu <= peer->hdrsize)
+		max_data = 500;
+	else
+		max_data = max(mtu - peer->hdrsize, 500U);
 	if (max_data < peer->max_data) {
 		if (peer->pmtud_good > max_data)
 			peer->pmtud_good = max_data;
-- 
2.53.0


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

end of thread, other threads:[~2026-12-03 18:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 18:13 [PATCH net] rxrpc: Fix max_data reduction on an oversized ICMPv6 PTB Andrew Stellman
2026-12-03 18:14 ` netdev-bot+sashiko

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