From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.143.172.20 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== 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== 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 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 ; Wed, 2 Dec 2026 17:32:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2027C606A323 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lausen.nl Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lausen.nl 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 Received: from devico.uberspace.de (devico.uberspace.de [185.26.156.185]) by mailgate01.uberspace.is (Postfix) with ESMTPS id 66E9260D34 for ; Wed, 02 Dec 2026 18:32:13 +0100 (CET) Received: (qmail 20663 invoked by uid 990); 2 Dec 2026 17:32:13 -0000 Authentication-Results: devico.uberspace.de; auth=pass (plain) Received: from unknown (HELO unknown) (::1) by devico.uberspace.de (Haraka/3.1.1) with ESMTPSA; Wed, 02 Dec 2026 18:32:13 +0100 From: Leonard Lausen To: netdev@vger.kernel.org Cc: leonard@lausen.nl, David Ahern , Ido Schimmel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , Simon Horman , Pablo Neira Ayuso , Florian Westphal , Phil Sutter , Shuah Khan , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, linux-kselftest@vger.kernel.org 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 Message-ID: <20261202173023.17220-2-leonard@lausen.nl> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261202173023.17220-1-leonard@lausen.nl> References: <20261202173023.17220-1-leonard@lausen.nl> X-Mailing-List: netdev@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 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 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= 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 --- 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