🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16637

[PATCH net v2 1/2] ipv6: honor prefix-length suppression in raw FIB lookups

#16637
From: Leonard Lausen
Date: Sun, 15 Nov 2026 11:44
55 lines
11480 bytes
IPv6 raw FIB lookups populate f6i and nh in fib6_result, but not rt6.
fib6_rule_suppress() only examines rt6, so fib6_lookup() ignores
suppress_prefixlength.

With a policy rule that suppresses the main-table default before looking
in a VPN table, an ordinary route lookup selects the VPN while an nftables
FIB lookup returns the suppressed default. Strict reverse-path filtering
can then drop replies arriving over the VPN.

For raw lookups, evaluate suppress_prefixlength against the FIB entry's
destination prefix length. Preserve results marked RTF_REJECT: raw lookups
can return zero with a rejection encoded in the result, while dst-based
lookups return an error and skip suppression. Check the result flags so
blackhole nexthop objects are covered as well.

Keep the dst-based path unchanged. Raw suppress_ifgroup handling also
remains unchanged because the table lookup's nexthop need not be the
final multipath selection.

Fixes: 138118ec96cb ("net/ipv6: Add fib6_lookup")
Link: https://github.com/firewalld/firewalld/issues/1600
Assisted-by: LLM
Signed-off-by: Leonard Lausen <leonard@lausen.nl>
---
Investigated with AI assistance after VPN failures. Reproduced on
unmodified v7.4-rc2 and verified with nft_fib.sh on the rebuilt kernel.

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

diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index 0ffd7b47a046..ceb4180bcf2f 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -283,9 +283,16 @@ INDIRECT_CALLABLE_SCOPE bool fib6_rule_suppress(struct fib_rule *rule,
 						struct fib_lookup_arg *arg)
 {
 	struct fib6_result *res = arg->result;
-	struct rt6_info *rt = res->rt6;
+	struct rt6_info *rt;
 	struct net_device *dev = NULL;
 
+	if (arg->lookup_ptr == fib6_table_lookup) {
+		/* Raw lookups report reject routes without an error. */
+		return !(res->fib6_flags & RTF_REJECT) &&
+		       res->f6i->fib6_dst.plen <= rule->suppress_prefixlen;
+	}
+
+	rt = res->rt6;
 	if (!rt)
 		return false;
 
-- 
2.55.0
Technical Details
Message-ID: <20261115114434.10343-4-leonard@lausen.nl>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363684-linux-kernel-netdev=dewy.ru
References: <20261115114434.10343-2-leonard@lausen.nl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363684-linux-kernel-netdev=dewy.ru
From: leonard@lausen.nl (Leonard Lausen)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2 1/2] ipv6: honor prefix-length suppression in raw FIB lookups
Date: Sun, 15 Nov 2026 11:44:32 +0000
Organization: Usenet Network
Message-ID: <20261115114434.10343-4-leonard@lausen.nl>
References: <20261115114434.10343-2-leonard@lausen.nl>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1783480"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:cMx39CZG8ExOan2GawILr2bNGYk= sha256:LAR9eHY/I2kcRisKucjNqFzj4/ho7ak/53j6QxuIywY=
	sha1:kdES2j2FtMXqHPKFwU1lXkHcjvk= sha256:xczQm1eaMy9B9aminLUn0an1BBLIIA6KG8XUW1ep49A=
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 E2CD31149BB; Sun, 15 Nov 2026 14:47:37 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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] 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 UyB4Kf7uWdVU;
	Sun, 15 Nov 2026 14:47:30 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-363684-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id CCAB01149B4; Sun, 15 Nov 2026 14:47:21 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 113CC391A8; Sun, 15 Nov 2026 11:47:20 +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=1794743239;
	b=2UzqchctGKjr13zifWiTbfjUV2ZErh661IXZy29YpY8DXbPtAoQM/oNhg3V/2X5IMq8E
	 x049x1Wor7fGhwIiz4ylyNguu9diU0clBUdXZNgr3Uq/hv5jwOYxhTmGmtAnsvJ3xjUcW
	 007P3BsiAO9ypulxkRI+Cc7qdQM42z3QrR41pe6AiHuD0QgtR/7YasGrIoH2fGNlV5bwy
	 yOat02Nehxn5wC9FdXw1E24VMdcyv0N5k3HYdl192zEt5lXzqAupHwGyl4tcNnWWFpvwD
	 +fZ/KyuUpvYW6z0xUH7ni+dGepmIpSfWNvQtPzSVtKNOozjzXOtzEDUzhOalWfgDbUQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794743239;
	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=GAr23D9nNi7WaHhPmdqYBMIdEmHnJfaXPVTLJAkqPSA=;
	b=CxiW6EJgijg0+GfH48jzVz5VgrK9TcTQiTnACsaVCiCGyjB5nTQvzZNBSJtoUTk+gtl2
	 5AmaDoG+GdrwXzRCDnNef5SrQKzRA59ZJQNi7LeAtvybDXs1Lmta/C4ih9w75fZzdobLr
	 EGg0AtmyG5/Hp9Pt1XG6u+6x2sbKz8N+t1SzaYxs/HTl4RWaOD9MpztzXP9+upVNx/5fd
	 TEJW7WtvVm4ZkB6xkXqZKl5ppi7nCkpHXXIuK7XxkFQpKf6TM2l+PUPOkUd4c08PY3Hlk
	 xzhm9MuKE+K+2c3arfRlB3ZMY2aHczwNYl6tiUzw/mtNsQ+Zjvd0Lss+TZRUlq3Xy/Q==
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=n8e082mi;
	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 8C310606A323;
	Sun, 15 Nov 2026 11:47:19 +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=n8e082mi
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=1794743238;
	b=5cMXsv8MBSJU4S+yxmEVVRyvZVwNvlXW279gpDx8WLzVjkQNKiRE9edOd+/tAcELzdPK
	 L7tDSraoLhywTe8Ad2ps5xJ/nWeGEj64B4sSAQzS5fMvQOo0LTUSXmbHuzxMy3JEXdt5E
	 xdvrnVUgFD3VXTcqc/ClHBV4BCqmYhYDFb9GCMSlNvPyuiixrpBjXf87/vPOiRSuG/L9t
	 HyfY7Bi6gxivD8bRKBJ+KcQHj2sFx3qepgVQeWkGpP3GcOCzIQfqkI2QWC4b21Ncv2mi3
	 ZMM0dWQrEd1kfWtxoy+Bwq4dOzlKfrdEgmDfnJFXdnwHjIHD4A2kugjNaNV151uwYTQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794743238;
	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=GAr23D9nNi7WaHhPmdqYBMIdEmHnJfaXPVTLJAkqPSA=;
	b=41nJ89qKcdBdJ917MLcagAcEXJ2x5qR4iqtC+mMfc869UEnXZcnncU6NG9Ghy0ytuD45
	 slXN0d5OhvNDVe35RFMql8zBy9brE36ajAGy9nhokcxU90i/GHlnjFePlHfSV/JIN6XYt
	 YfNqPgjTg+JvPWL2UM0HDeAbSz7qWa710oT0eZ35pqx6bpMno60D/ElC1mfJUYhCcwkQl
	 6Y5pUK7vAjOsT6nLsoDFTGx4N/2Xy7W5ylwznDys7kBiRFrKVLENZGn3HJtoVvNnVhRf0
	 umbemixu8sUQbMDWNvGuDoHz/R3ADF582oyNqTZyq2WsuElhqhHFf3r/Wu5nOELMXQw==
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=n8e082mi;
	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))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39CFE606A327
	for <netdev@vger.kernel.org>; Sun, 15 Nov 2026 11:47:18 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 39CFE606A327
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 9EF2A60D61
	for <netdev@vger.kernel.org>; Sun, 15 Nov 2026 12:47:16 +0100 (CET)
X-Received: (qmail 20124 invoked by uid 990); 15 Nov 2026 11:47:16 -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; Sun, 15 Nov 2026 12:47:16 +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>,
	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>,
	Daniel Borkmann <daniel@iogearbox.net>,
	netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org,
	linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
X-Mailer: git-send-email 2.55.0
X-In-Reply-To: <20261115114434.10343-2-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=GnUi2hnE6trAibYh7rXsZTD1pr9yyipJAU4UexF4GbU=;
	b=n8e082miTxM4FvKJ5NF/KkjTncoELCe5Xg8PIyjGgh5f1330jUikC+oyHhcxe0FvgfVUwauVvI
	p18aFen7uaHiNCh8x1MNX/6QCD1MNV/idzOu19jrHLeV9b4ya17qwThuzo5yCY3IhRJFOeBb39wk
	6VvL01vSq2Ad4uXdVEHept/yJVNbdljFnHarQ1aPjgR2vJjuq+rax2zzx+w83hx4kZVYHnxmNLUc
	mhcX5RL7hDmJGnwhz23o4g8clDjsPaA0FmU9zaNoZtHs0Z2erIqClvzDmObNMrm9q9WuOfrCj8vP
	Mk3Rqz6Dph9qiCYJVEun8ocA3r4yCsN9FqirqFgoZd/DmXNC/jnVyIUkLkPkZ6nNXv9nRgWNptgJ
	fXt4WZg5cx71OTUkvpMYIN/l6N26ahuKICrBig51O9HiDGykFUdv7nEJnji89qLlZGooTJZrkkGF
	UnorecimBZmp3QB0df5LZ9YWXH3QZ/kIgKJl8sAJqikw5dXyJysN4+JgrUNmNcX/bzWOE+pR/i7F
	bwspCRnfmp3Ipr4n/qtiX2xNV2A9OGPBxJRd9EldkSOw+racZUv5E2Jc7xaDxay/Vf56bsCCcgyl
	YPbALgJyM5riQli2KViSxEfL/OnuLhcpLaJqpqSWWOzO22Q21yhiEpY0pBaipvA7Jk1QeJw4txm1
	o=