🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25896

[PATCH net-next 1/2] ipv6: Use the FIB prefix length when suppressing cached routes

#25896
From: Leonard Lausen
Date: Wed, 02 Dec 2026 17:30
61 lines
11930 bytes
fib6_rule_suppress() compares suppress_prefixlen with rt6i_dst.plen.
PMTU and redirect exception routes have a /128 destination prefix even
when their parent FIB route is a default route. Consequently, a cached
exception bypasses suppress_prefixlength 0 and stops the rule lookup
instead of continuing to a later table.

Use the parent FIB entry's destination prefix length when available.
The rule lookup already holds the RCU read lock needed to read rt->from.
Retain the existing prefix check if the destination has lost its parent.
Interface-group checks and destination reference handling are unchanged.

Identified during maintainer review and reproduced using an ICMPv6
Packet Too Big in network namespaces, without kernel instrumentation
or error injection. The reproducer and nft_fib.sh pass on a rebuilt
net-next-based kernel.

Fixes: 7764a45a8f1f ("fib_rules: add .suppress operation")
Link: https://lore.kernel.org/netdev/20261117091340.GA581197@shredder/
Signed-off-by: Leonard Lausen <leonard@lausen.nl>
---
Previously included in v3 of the prefix-suppression series, then removed
at review to be sent separately to net-next after the prerequisite fix.
The implementation is unchanged; the message records current validation.

Review:
https://lore.kernel.org/netdev/20261117091340.GA581197@shredder/

 net/ipv6/fib6_rules.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index 7efb0515b5c8..2f43e4e48e0d 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -285,6 +285,8 @@ INDIRECT_CALLABLE_SCOPE bool fib6_rule_suppress(struct fib_rule *rule,
 	struct fib6_result *res = arg->result;
 	struct rt6_info *rt = res->rt6;
 	struct net_device *dev = NULL;
+	struct fib6_info *from;
+	int plen;
 
 	if (arg->lookup_ptr == fib6_table_lookup) {
 		/* fib6_table_lookup() returns 0 for reject routes. */
@@ -298,10 +300,13 @@ INDIRECT_CALLABLE_SCOPE bool fib6_rule_suppress(struct fib_rule *rule,
 	if (rt->rt6i_idev)
 		dev = rt->rt6i_idev->dev;
 
+	from = rcu_dereference(rt->from);
+	plen = from ? from->fib6_dst.plen : rt->rt6i_dst.plen;
+
 	/* do not accept result if the route does
 	 * not meet the required prefix length
 	 */
-	if (rt->rt6i_dst.plen <= rule->suppress_prefixlen)
+	if (plen <= rule->suppress_prefixlen)
 		goto suppress_route;
 
 	/* do not accept result if the route uses a device
-- 
2.55.0
Technical Details
Message-ID: <20261202173023.17220-2-leonard@lausen.nl>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375954-linux-kernel-netdev=dewy.ru
References: <20261202173023.17220-1-leonard@lausen.nl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375954-linux-kernel-netdev=dewy.ru
From: leonard@lausen.nl (Leonard Lausen)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next 1/2] ipv6: Use the FIB prefix length when suppressing cached routes
Date: Wed,  2 Dec 2026 17:30:21 +0000
Organization: Usenet Network
Message-ID: <20261202173023.17220-2-leonard@lausen.nl>
References: <20261202173023.17220-1-leonard@lausen.nl>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2020378"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Nah+QsgOZM+JVTl/MePhdhCM64U= sha256:fgxUImWCCpC57sjegieo36HRc64N3ZAB3heTDKj2hmQ=
	sha1:+8LpIGrRG9sPAGWMvO9ec9KaQ2c= sha256:PiDQWpme8UYigh4lFQ8xJ2oYkBeoOqBi/M6HnvPB1bY=
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 5D0351176AC; Wed,  2 Dec 2026 20:32:44 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.15
X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (4096-bit key)
	header.d=lausen.nl
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 cpzu0KH96wFi;
	Wed,  2 Dec 2026 20:32:36 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-375954-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lausen.nl
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 5CC44117694; Wed,  2 Dec 2026 20:32:25 +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 DCF2C27D63; Wed,  2 Dec 2026 17:32:23 +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=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796232742;
	b=ZnLcdBtFtqPN9yV82cZzFZDoNWUOrfkBSKhAnXUeA5XSpS+8i1ZM4UXLnfaqEj4iXWGj
	 9T6mGp8W/d4/dg+KKwX/FUIdJ7ksaYKtjXNUOejVXHxd674msJqzJA4ul7C9ECZrzz0YD
	 6xJUOUa3bY1D1ZwYD5porpwxPEY9cWL+abZgtWYmnQ1021HJPIXuiSbS0g8MYWQVJ5B2i
	 ykp4/0rWgaQdsM4zA1bH6harJImBEe2DHquRvW0IsbNHHteoE4lAOii8J8CXzf2l7aiJk
	 yPFuA6l+MXBx0QIG8AawY2lNTDSMTFCoeDm8DOHcIJCdAe+2qv0nmpfzfAFbcfpHPvQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796232742;
	h=X-Original-To:Received:DMARC-Filter:Received:Received:Received:From:
	 To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding:X-Rspamd-Bar:X-Rspamd-Report:X-Rspamd-Score:
	 DKIM-Signature;
	bh=3pSsbmOmhGSESCnJFIhs2hxyh0+BoNw4dlkVqrcDxfg=;
	b=kSb241afzNDIa75gaEVgQAU45HAKvbDe4U8BBhppGfP66DM6itGf3AEhG62oo4snTQF6
	 EYLP6uetCzkvrrdpztkZKAyvMYIdTbq2mF5T1va8MfrdKt09Mw91Vqo3i74mf9cymzZkt
	 /ijV4T/5GlVldy2yZ3/zRWhZbpexdIoB3BRt7c34faE5x62H7lhSqzXNp00luy1ljxLrq
	 9lplz7laOB/AkqADLnWvJwzXgOsyeHuUqDuyEjYXi6jD5AIKCNz0/SDQNzMymC+h8rYKe
	 88ID/ElAGi94WkReh9TMEjnpRkkMrE8fv3q5fqkNmUBlqHk1FJKMnrvPfOfggRlF7aw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=lausen.nl header.i=@lausen.nl header.a=rsa-sha256 header.s=uberspace header.b=EK+9xoaE;
	dmarc=pass header.from=lausen.nl;
	spf=pass smtp.mailfrom=lausen.nl;
	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 D2E62606A33D;
	Wed,  2 Dec 2026 17:32:22 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (4096-bit key) header.d=lausen.nl header.i=@lausen.nl header.a=rsa-sha256 header.s=uberspace header.b=EK+9xoaE
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.143.172.20
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796232742;
	b=gFz6PQZgipnq2AP0aTmUP5Qk4B7Xb/U3kzdFIa3FdRIIS9+m9f/79v9DCcd5vR0cXthc
	 rKEI+P6kL213am21QkFuXWlEqTpUH0w/I2NY8+k1Dq6r+IcFbYEMW+JxUnU0psJrX+NCL
	 jRp2GbGflQa98ZTxO5W4DVJNyPJ/pWvNIjzRJtZsuiIEPGKZXWeuuOwcRSRj7la0KGlwI
	 p3KSiKtt5vx9L6SD/LT4rBdDn3dfkPVG5TVRIl9mtBUvnaojymUyo3A7/cXXsJMDWvSsd
	 R7U37aIflYVHB7HrbOEFpalzzksdIWzTSWe0EkFWcHLTH7fMBbXxf3/ab/F+h+vYPOg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796232742;
	h=DMARC-Filter:Received:Received:Received:From:To:Cc:Subject:Date:
	 Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding:X-Rspamd-Bar:X-Rspamd-Report:X-Rspamd-Score:
	 DKIM-Signature;
	bh=3pSsbmOmhGSESCnJFIhs2hxyh0+BoNw4dlkVqrcDxfg=;
	b=qR3HpGGOt4oZfPp4OVBfHY9sNhjopmVD5EugLHrdiMaToJpSYXTveC5cUaqnm2a44yto
	 oB+FPBw8PeH0mx9XTqkTsvhea18wAFA6WtNiVqPsMDm9ir9aR4ethmvUyOKGWIGVzxbvt
	 6VYm5LtL53tHCJldg2vhA47SeEcraKBgkUwlHJ46mXmNe9BseEfN5Si6FEBV2y9kIeWSZ
	 Cg8og5iiOAfG+fQbzXYm1HlIe80D+tKwuPzZuKDA5ciaA4Qs/huPSPvAXDdGkpw0d6Dtt
	 sVe/ZAM/WmcwRM6ypLuu1ZXB4cufw69Q78IyIcmIl1keXBR7IBWCAYkl1Scy/47BfZw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=lausen.nl;
	spf=pass smtp.mailfrom=lausen.nl;
	dkim=pass header.d=lausen.nl header.i=@lausen.nl header.a=rsa-sha256 header.s=uberspace header.b=EK+9xoaE;
	arc=none smtp.remote-ip=95.143.172.20
X-Received: from mailgate01.uberspace.is (mailgate01.uberspace.is [95.143.172.20])
	(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.subspace.kernel.org (Postfix) with ESMTPS id 2027C606A323
	for <netdev@vger.kernel.org>; Wed,  2 Dec 2026 17:32:20 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2027C606A323
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lausen.nl
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lausen.nl
X-Received: from devico.uberspace.de (devico.uberspace.de [185.26.156.185])
	by mailgate01.uberspace.is (Postfix) with ESMTPS id 66E9260D34
	for <netdev@vger.kernel.org>; Wed, 02 Dec 2026 18:32:13 +0100 (CET)
X-Received: (qmail 20663 invoked by uid 990); 2 Dec 2026 17:32:13 -0000
X-Authentication-Results: devico.uberspace.de;
	auth=pass (plain)
X-Received: from unknown (HELO unknown) (::1)
	by devico.uberspace.de (Haraka/3.1.1) with ESMTPSA; Wed, 02 Dec 2026 18:32:13 +0100
X-Cc: leonard@lausen.nl,
	David Ahern <dsahern@kernel.org>,
	Ido Schimmel <idosch@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Willem de Bruijn <willemb@google.com>,
	Simon Horman <horms@kernel.org>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Florian Westphal <fw@strlen.de>,
	Phil Sutter <phil@nwl.cc>,
	Shuah Khan <shuah@kernel.org>,
	netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org,
	linux-kselftest@vger.kernel.org
X-Mailer: git-send-email 2.55.0
X-In-Reply-To: <20261202173023.17220-1-leonard@lausen.nl>
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-Rspamd-Bar: -----
X-Rspamd-Report: REPLY(-4) BAYES_HAM(-2.999999) MID_CONTAINS_FROM(1) MIME_GOOD(-0.1) R_MISSING_CHARSET(0.5)
X-Rspamd-Score: -5.599999
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
	d=lausen.nl; s=uberspace;
	h=from:to:cc:subject:date;
	bh=zSh5gU55ppFzz4yV8YcC4penT6Hb0zuHmL+DRI/fap8=;
	b=EK+9xoaEEZKanaNcfyAdEj959nm5CGMIsAxppaQFuM4Yxuftmxf9LGuoGKxKf58bvtznUwIBER
	vDJo5o7rC2VjvqBieBBYiA90JkEDQ2us7v2j/rWbebfI4dsaU/PkTUcBhDg+ejAhnq3MJJjGLfA9
	i1PiiGMsF64uN7XRMEKe9bu8oGLYUfO/Hb2Qj6VW9/KgCwtXEjdYcKeb1lFQEXRZDsxtXiCdG5o7
	/xRK1ywPdRHyPFG/QsT4kPNNW6IGlkjse1kVC0PACMUG46v1LIFPATvplbtUNcyRKxcV/IinpW96
	dNWfo0LZvsuIMG8S5ub9BUj1+2V7iujSUBps0BWjXp1ZDYGmJXDU6rmEJyio8udo/R9mCNxUWe80
	yNimGOyXyqckL3hoDOwsXxRdxy1Avw8FlFv4Hi82ci5g2LemlYZyHoZIxG6Kmvfcjvo7UXZiU2xs
	ChykENAoBkjZCQixke6YcS6Fm5FAuQFSxspWCwslXQkR921CWtlBOh2z4tRl6eZuybnGPJqvn7Ry
	Kr2lgQY8EhBHHZD8DDKlNP8xYk44esvM+sfZrICn3X5NdBcNHZAnlXrrILFtH4GFzqNtt85Um1Be
	l/Zu/MtAXItEch6j7gUMk7xo/YNmj5m9ihgGTtKRm93PRyUL+Cgm75dfMTUT3+vYbbKDQje8e5a9
	8=