Netdev List
 help / color / mirror / Atom feed
From: Andrew Stellman <bugs@stellman-greene.com>
To: David Howells <dhowells@redhat.com>,
	Marc Dionne <marc.dionne@auristor.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	linux-afs@lists.infradead.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH net] rxrpc: Fix max_data reduction on an oversized ICMPv6 PTB
Date: Wed,  2 Dec 2026 13:13:19 -0500	[thread overview]
Message-ID: <20261202181319.74045-1-bugs@stellman-greene.com> (raw)

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


             reply	other threads:[~2026-12-02 18:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 18:13 Andrew Stellman [this message]
2026-12-03 18:14 ` [PATCH net] rxrpc: Fix max_data reduction on an oversized ICMPv6 PTB netdev-bot+sashiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261202181319.74045-1-bugs@stellman-greene.com \
    --to=bugs@stellman-greene.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.dionne@auristor.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox