🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #14693

Re: [PATCH net-next 1/2] netfilter: nft_fwd_netdev: drop the stale dst when steering to a device

#14693
From: Pablo Neira Ayuso
Date: Wed, 11 Nov 2026 21:33
67 lines
11282 bytes
On Wed, Nov 11, 2026 at 09:16:37AM -0500, Jamal Hadi Salim wrote:
> This is a followup of the review of the teql arp-queue fix as reported
> by Sashiko.
> 
> The issue: the neighbour variant of fwd rewrites skb->dev to the
> configured output device and calls neigh_xmit(), but leaves the skb's
> dst untouched. If that device's neighbour for the configured nexthop is
> incomplete, the packet is parked on the neighbour's arp_queue while the
> stale dst still describes the device the packet was routed through.
> Draining the queue re-looks the neighbour up from that dst, so the frame
> is built with the routed device's link-layer header and then transmitted
> on the configured device. The packet leaves with another device's
> addresses.
> 
> The Fix: drop the dst before the device switch. Both lookup inputs the
> neighbour transmission needs, the device and the nexthop, are supplied
> by the rule, so the route dst is never consulted. Without it the queue
> drain keeps the parking neighbour and the frame carries the configured
> device's addresses.
> 
> Conditions to recreate the bug: two network namespaces, A (10.10.0.1/24)
> and B (10.1.0.1/24) in one, their veth peers in the other with only A's
> peer addressed (10.10.0.2/24) so B's nexthop cannot be resolved by ARP.
> Resolve A's neighbour for 10.10.0.2 as permanent, then load this ruleset
> on A:
> 
>     table netdev t {
>             chain c {
>                     type filter hook egress device va priority 0
>                     policy accept
>                     fwd ip to 10.1.0.2 device vb
>             }
>     }
> 
> Send one packet to 10.10.0.2. It is parked on B's incomplete neighbour
> for 10.1.0.2; once that neighbour becomes valid the frame leaves B
> carrying A's source address and A's neighbour as the destination.
> 
> Reported-by: Sashiko (nipa) <sashiko-bot@kernel.org>
> Closes: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/QDISC-6HS9.v3.r0.20261103062649-2@mojatatu.com
> Link: https://lore.kernel.org/netdev/QDISC-6HS9.v3.r0.20261103062649-2@mojatatu.com/
> Reviewed-by: Victor Nogueira <victor@mojatatu.com>
> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
> ---
>  net/netfilter/nft_fwd_netdev.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/netfilter/nft_fwd_netdev.c b/net/netfilter/nft_fwd_netdev.c
> index a48c2f765bba..ad4d61d64cdd 100644
> --- a/net/netfilter/nft_fwd_netdev.c
> +++ b/net/netfilter/nft_fwd_netdev.c
> @@ -175,6 +175,7 @@ static void nft_fwd_neigh_eval(const struct nft_expr *expr,
>  		}
>  	}
>  

Does this need a check for skb_dst_valid()? I think it is valid to
attach a template dst here for tunneling?

> +	skb_dst_drop(skb);
>  	skb->dev = dev;
>  	skb_clear_tstamp(skb);
>  
> -- 
> 2.43.0
> 
Technical Details
Message-ID: <avTfQjFQYR2NNdRg@chamomile>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361287-linux-kernel-netdev=dewy.ru
References: <CORE-9NOG.v1.r0.20261111073528@mojatatu.com> <CORE-9NOG.v1.r0.20261111073528-1@mojatatu.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361287-linux-kernel-netdev=dewy.ru
From: pablo@netfilter.org (Pablo Neira Ayuso)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 1/2] netfilter: nft_fwd_netdev: drop the stale
 dst when steering to a device
Date: Wed, 11 Nov 2026 22:33:54 +0100
Organization: Usenet Network
Message-ID: <avTfQjFQYR2NNdRg@chamomile>
References: <CORE-9NOG.v1.r0.20261111073528@mojatatu.com>
 <CORE-9NOG.v1.r0.20261111073528-1@mojatatu.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Injection-Info: usenet.network;
	logging-data="943257"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:4lbGiFSZU330rcjHl/svXd1aYKc= sha256:l1ev6YhcKSFIDOMRInVBLDNzihqZB88ygDPwI+CfzoE=
	sha1:aCtDoGmV+Nt6VaMlULFLwg+C7sY= sha256:gLiDI6O0Wh5tBB3ZyfzTXrUkqOm4dDa6RL7WYp3XeuU=
Content-Disposition: inline
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 BF77711402D; Thu, 12 Nov 2026 00:36:01 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 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, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=netfilter.org
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 3cplvDHMZik4;
	Thu, 12 Nov 2026 00:35:56 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-361287-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=netfilter.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 9D7E8DDE13; Thu, 12 Nov 2026 00:35:46 +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 BBDE1C0C46; Wed, 11 Nov 2026 21:34:02 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail;
	t=1794432841;
	b=m4CtvygfRgAClFVeIb79iG9wuMEAF6HwopM93jm8eVij7GLsAbstVHdz6RMnAeYu/lmq
	 7wMw3bD6z8N6/BaXb5qAfytE01KAezel6U4alA23ZwYsHkXmNWbVVrDh/YjgvgRR9PuG/
	 99OTEHx6xFEqM9NvVtUqmqydIEDkwFge+8I9nwp/xSDq+Wxj/iggvrAyCSL0g9jfHoeoj
	 nvtglU4QVOFTadJjrsiCp9316pRdojx3abdfCgShokN/TnWnIw8JFh7fJujRRWgSs1V7j
	 kqBHr00Vmrm9e6lrq+hkog6u0VtflCUldpYTOKKJA22URLxVj8/bCpCYKs52jBAgeEg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794432841;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date:
	 From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=XsrLygMXUO8t6Dug7THlfgRGdAUk0g1VTR1xNcAcyYQ=;
	b=alW9q25fgrnxCy94JsfCqAb420fXSCekCrGWczrm6BPFKyOTL6hkJ43JA7t8IEofGCmW
	 t0iFKvL6V6FeK9HxUp8mj5Wo3UiO26Bap3/0vyOGyn5KrYHo7jcK3EjvoebruSKlpq2f4
	 N6YEi4LEQkH2Pa5tR0pjRZbo8Z02vaIyoDV4R3M7SyEhLogcBYAZu3YL/wM2kupl9WqeZ
	 gJLpRcovqyinUVxO6s0gcKL3v3V/Q/x44ou13ebpWoWiCNluze2KglBehWuG9KA/MFX0Z
	 iFTY+1gve+CrD00M83o/JLx5ckGZDgkyZ68pPokyTWd9M4gbHUYYQjuYW7unvZtS2rQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=FiUqzxbo;
	dmarc=none header.from=netfilter.org;
	spf=pass smtp.mailfrom=netfilter.org;
	arc=fail 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 E73AC606A335;
	Wed, 11 Nov 2026 21:34:00 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=FiUqzxbo
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.70.190.124
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794432840;
	b=ILqNxA6z48kdJmkvqAqsSUezmwAdfp002DECsQnssjSbH9PodaACk2O+AlMStmNrTDJa
	 SwhN5HF/TDEAsxrf9JCXY/ICIrO9H5gGpV3VQgPoRrenwKCqAPvkGCttsglmlh6EdvRg8
	 0GZK1PPrcGWBsCN1QnHYxu1Jie+o38yw/yzLYIQaJWR5sAfsDVNla6suNVUmcQfxufD9s
	 nmrRqJoS08wFqGz5bgtU3POmy9HwLN3u060wpVr9S2MA4KiBRMWe4fcTuScdj8ujsw7w1
	 Z5IBQWO0lRNO9k3oVxJQVlaIavPiHWPdsBx8RIicEHyeveseL3IriZd6KEDDpMmSIFA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794432840;
	h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject:
	 Message-ID:References:MIME-Version:Content-Type:Content-Disposition:
	 In-Reply-To:X-Spam-Status:X-Spam-Checker-Version;
	bh=XsrLygMXUO8t6Dug7THlfgRGdAUk0g1VTR1xNcAcyYQ=;
	b=j/Yz9ErKaLEbyEjyw7MxkkME0jOrktxwEZzaPc827lk/101v4YPCKfcpghmYMAuZWVPh
	 oMMWUAEJE0n5Bg1qFspQi6vm9jRYW/1eidoCo03AO86T2HyZVaABXBjoCvdq/MXvfkmpz
	 hOvKRlzcAM66t/yuZLRJiReYJlgsGQR1XR0V11LV/raV58YZDGUYs4lIb/i9TZx/llMfj
	 tT2bDALHRIUepeQcX4E4hm+VJSMDXb78I8LJgnXNPjlGvXRANt+dPa69jgrTBV6xRNPoN
	 LPMib2iSLCrexA7zAOH3P8q2tu0h4azR9vrwGyXzV7glL0dhVD/qMnOdnK/nT9BVLgA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=netfilter.org;
	spf=pass smtp.mailfrom=netfilter.org;
	dkim=pass header.d=netfilter.org header.i=@netfilter.org header.a=rsa-sha256 header.s=2025 header.b=FiUqzxbo;
	arc=none smtp.remote-ip=217.70.190.124
X-Received: from mail.netfilter.org (mail.netfilter.org [217.70.190.124])
	(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 UTF8SMTPS id F16C8606A31C;
	Wed, 11 Nov 2026 21:33:58 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F16C8606A31C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netfilter.org
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfilter.org;
	s=2025; t=1794432836;
	bh=XsrLygMXUO8t6Dug7THlfgRGdAUk0g1VTR1xNcAcyYQ=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=FiUqzxbojTrjYQStNsMK4iPs7PDMTYrw1WVtRyWjKQgvgspoTYGhdDgKqKg3VXaR2
	 Z4xolKhdeZazfy/7IBx81+2Xk5TCYJJh/Iba/uGQX7iONDs9+sjyyOfep4uLrBANP4
	 m3nCD8V+YdNjciB4SDqbATGOhucXByeU5wMeMi6+y4S+n45/poO5wfAcvrrUIftMaT
	 TXLe4iaJA3BbiRk3fpBSOJ5hMZsCzKwazfUuYc9/RssB80mVT613VeRSPMjQJV029D
	 uoIWXLLeNF25O8hBDqiFkCG6uTlTzVyWFGxG13yvc4hFIrN2JsetnDmQmG826geWR9
	 +3I8CTizo/Uow==
X-Received: from netfilter.org (mail-agni [217.70.190.124])
	by mail.netfilter.org (Postfix) with UTF8SMTPSA id 91FA260051;
	Wed, 11 Nov 2026 22:33:56 +0100 (CET)
X-Cc: netdev@vger.kernel.org, Florian Westphal <fw@strlen.de>,
	Phil Sutter <phil@nwl.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>, netfilter-devel@vger.kernel.org,
	coreteam@netfilter.org, Victor Nogueira <victor@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>, sashiko-bot@kernel.org
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-In-Reply-To: <CORE-9NOG.v1.r0.20261111073528-1@mojatatu.com>