🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16671

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

#16671
From: netdev-bot+sashiko
Date: Sun, 15 Nov 2026 14:42
110 lines
12071 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit fixes a real wire-level bug in nft_fwd_neigh_eval()
  (net/netfilter/nft_fwd_netdev.c) but has no Fixes: tag and no Cc:…
- [Low] The commit message says the rule supplies both the device and the
  nexthop "so the route dst is never consulted", which implies dropping…

--

netfilter: nft_fwd_netdev: drop the stale dst when steering to a device

This patch makes nft_fwd_neigh_eval() drop the skb's dst before it
switches skb->dev to the configured output device and calls neigh_xmit().
Without the drop, a packet parked on an incomplete neighbour's arp_queue
can be re-resolved through the stale dst when the queue drains. It then
leaves the configured device carrying another device's link-layer
addresses.

Link: https://lore.kernel.org/netdev/QDISC-6HS9.v3.r0.20261103062649-2@mojatatu.com/

> 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>

[Severity: Low]
Should this have a Fixes: tag and Cc: stable?

The skb->dev = dev; followed by neigh_xmit() in nft_fwd_neigh_eval(),
with the skb's dst still attached, came in with:

d32de98ea70f ("netfilter: nft_fwd_netdev: allow to forward packets via neighbour layer")

The bug became much easier to hit once nft_fwd_validate() allowed
NF_NETDEV_EGRESS, because egress skbs always carry the output route's
dst:

f87b9464d152 ("netfilter: nft_fwd_netdev: Support egress hook")

The reproducer in the commit message uses an egress chain. Without a
Fixes: tag, stable backporters can't tell which trees need this fix.

> diff --git a/net/netfilter/nft_fwd_netdev.c b/net/netfilter/nft_fwd_netdev.c
> index a48c2f765bbaa..ad4d61d64cdde 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,
>  		}
>  	}
>  
> +	skb_dst_drop(skb);

[Severity: Low]
The commit message says:

    Both lookup inputs the neighbour transmission needs, the device and
    the nexthop, are supplied by the rule, so the route dst is never
    consulted.

Is that accurate? The arp_queue drain is not the only place that reads
the dst. If the target neighbour never resolves, the neighbour's
error_report hook also reads it:

neigh_xmit()
  neigh->output()
    ... resolution fails ...
    arp_error_report() / ndisc_error_report()
      dst_link_failure(skb)

include/net/dst.h:dst_link_failure() {
    ...
	if (dst && dst->ops && dst->ops->link_failure)
		dst->ops->link_failure(skb);
    ...
}

Before this patch, an egress skb handled by "fwd ip to <nh> device <dev>"
whose nexthop never resolved still had its route dst. So
ipv4_link_failure() or ip6_link_failure() sent ICMP host unreachable or
ICMPv6 address unreachable back to the sender, and expired or
invalidated the original route.

Once the dst is dropped, dst_link_failure() returns without doing
anything. __icmp_send() also needs skb_rtable(skb_in), so the packet is
now dropped silently. Local senders no longer get EHOSTUNREACH feedback,
and the route is not expired.

The new behaviour is arguably more correct. The old ICMP and route
expiry applied to a route and device the packet was no longer using,
and the new behaviour matches the ingress hook, where skbs normally have
no dst.

Could the commit message mention this change in user-visible behaviour?

The follow-up patch "bpf: drop the stale dst when redirecting to an
explicit nexthop" makes the same claim for bpf_redirect_neigh(), so the
same question may apply there.

>  	skb->dev = dev;
>  	skb_clear_tstamp(skb);
>

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/CORE-9NOG.v1.r0.20261111073528%40mojatatu.com
Technical Details
Message-ID: <179475377256.2199510.7063513352863534262@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363726-linux-kernel-netdev=dewy.ru
References: <CORE-9NOG.v1.r0.20261111073528-1@mojatatu.com>

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-363726-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
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: Sun, 15 Nov 2026 14:42:52 +0000
Organization: Usenet Network
Message-ID: <179475377256.2199510.7063513352863534262@kernel.org>
References: <CORE-9NOG.v1.r0.20261111073528-1@mojatatu.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1827397"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:okoLu22EURVe0JDFNledahmFQPs= sha256:ggGJ5Qk5hPb3TqirkSTeFzKYAzRMPr2HvSv8dod/6ww=
	sha1:VbveY5G6LQcZ2Bb/lizsQSw0w8M= sha256:doNn4asj4U8kRUSzVfz/EBcEZzBcVbzOSG55UWUpjUM=
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 DF5741149C9; Sun, 15 Nov 2026 17:43:24 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.501
X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 (2048-bit key)
	header.d=kernel.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 cYfptDKmQ8Q6;
	Sun, 15 Nov 2026 17:43:17 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-363726-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 660351149E6; Sun, 15 Nov 2026 17:43:08 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id C648B606AE4; Sun, 15 Nov 2026 14:42:55 +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=1794753775;
	b=V+1gMyBY5b7Z+Z+i6TcW3JMYbBJ2o2QZh4mpyWe5WDH1vgjCdkt9RBVKVDRgwHmmzjFQ
	 YwGm+KPNc4ro41wFy/8G3sfMfARN66d6FMvgbj3mm+90WyL4xSpG+/QgO6mV27escPTcr
	 dGNmxoMq7vxRWk4dmJFahEv22XEC21QxMKApLQMC8jY/ZUWrOjMOxyvdJSOsJL2N0Nc9o
	 4+tNJYDhSPxWt9hWe6g8JwI4YoBpvIuMBhW8CNKjOCTss3cNnGCM3gfMpadAum1pK6Pyn
	 3bX1/M9nkHqr+tznfsq7N5UwJYuheOKAKEhAPH0k//a0Gk+KjUZ5JEpKtcCK+tVJuwA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794753775;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=Dl9/HggcS4fydY7rUkoqQ91fLGnVu7gHe7o/RWfBPTw=;
	b=L73yc5/gRN0UskJqhECA5geyy0Ehx3EJQnVMMwYXT8vDZxHNPirKhXYL14AVRkI8lDtN
	 B8E5FPQ3sc3H8844BnJEgD7kZwuHS2DjTH4U1D+AWW21qEzIG/BMqa6AxBoDwjTwQM+O+
	 K5mg0UHZMnHqYCokpYWSwFoPOUQ34UkhzqQi27F6TrV/3Z0LqqSnMkazkRGor8eU2O968
	 S8lCTeV9XoPWxpd3ivukthrOiEsJn+kgHugnMDW66xr0k7fCejP+DlabSPSP4ETmz50gc
	 yQcxNA/SwEtqS3Pf/Royaa5iJG0RGFvXVgBhvxXiTDQC3xfUKnHPxwxi2g2m9ONkykA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ngW8qcHJ;
	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 DEA17606A32D;
	Sun, 15 Nov 2026 14:42:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ngW8qcHJ
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794753774;
	b=n0YdbZanrPDtoUUB5bSxQ8nqIrx83hytp00c4DdjSbz5IWQZxA0JqSrhoDwhkWYTLMTx
	 wBvn3egaCu7TGBHOrzwrOQpRZm7QCvTQdiuxHzRV0Hb7aCtj1wY9kW8bKj8upIsCWJ0AP
	 pqOIGCZyGPT94iDp0K1YKyakF0TooZ+wxJcrCvLUqHc6TUArKFwa8NX7bUQbSzNGn22sy
	 ychCk6T501bf0z8mHTYD2hYPCIRtR2WOihhbQVhkby90LjWdofmyH1vqm0cbV/cWqeEkb
	 c1XaplpzvNtvcEYa6+GOCl7bDrQhyRA0s6o2llUhWbYeBLMTIBQgunEPK507duYYOAA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794753774;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=Dl9/HggcS4fydY7rUkoqQ91fLGnVu7gHe7o/RWfBPTw=;
	b=T2X3N+FPM/2VsRM5eNetL6jblonCxMHtzJEXLkXe/xedenCntLbrySf9rgPhViGgUAoi
	 7Wd1EMxW1YAUhdQZg/9oT9zomJmSh/mu1OkWKOQ+grXvQuTWCLzQhcOrsPtFCHKKTHiOR
	 WP+ZxwZc/ohp+IJlEyGtEt512WO2eoCZq4Ylswbs2JFCn2O1Fprmd2fk+wrh0vO00xVvl
	 hwAr8bXxLmPYQgCgLDHQlWgM9LXYIcoxF1egSGlERzteTKPXmhnVyqX5dE+xn7NkqYr4V
	 NbPKe8NsYVPaX9/lJ9s74ZqiuyssYWwN0E77PAuYf8FBt9R+pSVt2T0Fz1LVfGsbSCQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ngW8qcHJ;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(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 08B09606A323;
	Sun, 15 Nov 2026 14:42:54 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10A961F000C4;
	Sun, 15 Nov 2026 14:42:53 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794753773;
	bh=Dl9/HggcS4fydY7rUkoqQ91fLGnVu7gHe7o/RWfBPTw=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=ngW8qcHJg1cVNvohnVIydcn8FsmI4aJqDtKuzhWyG87Sm2K5abN53oIg0B/W6F6JN
	 DGqJ8wTwwA1qJKMUn/HJC0UuswV3os2cI86nf16I1wu7RSSZ7t+J0jR+Y59EKeUUkD
	 OlrvawLkuvGGKzkerCnhwz8bWmVrOuHZQqtRMOF/XbzC+bAg5rR6Bnf9MJc0C+BQc2
	 LSehEmb2mOWR4mCQJhP3nqwAvJLwrT0Uk4FeRYYQHwkEaBoN1VX8CUfGrKgh2h/0QR
	 USR1vcVh8muW9GSWH+E93P/YYoWPWJJ0noJIPuVXRy4q2DzGAcHyOlH+Zqs7hYS86u
	 UxU/dAW6yi6Qw==
X-Cc: netdev@vger.kernel.org, pablo@netfilter.org, fw@strlen.de, phil@nwl.cc,
 davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
 horms@kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
 victor@mojatatu.com, jiri@resnulli.us, sashiko-bot@kernel.org
X-In-Reply-To: <CORE-9NOG.v1.r0.20261111073528-1@mojatatu.com>
X-sashiko-severity: Low
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