Article View: linux.kernel.netdev
Article #15700Re: [PATCH net-next v2 3/4] netfilter: nft_fwd_netdev: drop the stale dst when steering to a device
From: Pablo Neira Ayuso
Date: Fri, 13 Nov 2026 09:47
Date: Fri, 13 Nov 2026 09:47
53 lines
11124 bytes
11124 bytes
On Thu, Nov 12, 2026 at 03:40:48PM -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:
> Release 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.
>
> The release goes through skb_dst_drop_keep_metadata(), so encapsulation
> parameters a route carries are handed over to a metadata dst instead of
> being lost, and a metadata dst already on the packet is left in place. If
> that copy cannot be allocated the packet is dropped, never sent with the
> stale route.
>
> 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/
> Link: https://lore.kernel.org/netdev/avTfQjFQYR2NNdRg@chamomile/
> Reviewed-by: Victor Nogueira <victor@mojatatu.com>
> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
Technical Details
Message-ID:
<avbcwzUuzp3ZnjCM@chamomile>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362525-linux-kernel-netdev=dewy.ruReferences:
<CORE-9NOG.v2.r0.20261112151659@mojatatu.com> <CORE-9NOG.v2.r0.20261112151659-3@mojatatu.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362525-linux-kernel-netdev=dewy.ru From: pablo@netfilter.org (Pablo Neira Ayuso) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v2 3/4] netfilter: nft_fwd_netdev: drop the stale dst when steering to a device Date: Fri, 13 Nov 2026 10:47:47 +0100 Organization: Usenet Network Message-ID: <avbcwzUuzp3ZnjCM@chamomile> References: <CORE-9NOG.v2.r0.20261112151659@mojatatu.com> <CORE-9NOG.v2.r0.20261112151659-3@mojatatu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Injection-Info: usenet.network; logging-data="1332352"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:j0iCpfQZnSV+dP+/zVnps2FJ6QA= sha256:nbGtIPgTicxlrb1XL62d40gXMBDOs6nLZeQOch9uW5E= sha1:77reEYdw++yS5PQDch/fQuXPo5w= sha256:j71P07quvKPqqzw1xr8GluBBZYVSR4t1dkhpTY3MXXU= 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 883D0114512; Fri, 13 Nov 2026 15:06:57 +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 9FGI55wS0_VU; Fri, 13 Nov 2026 15:06:49 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-362525-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 D530211450C; Fri, 13 Nov 2026 15:06:38 +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 B0B192C4F4D; Fri, 13 Nov 2026 09:47:57 +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=1794563275; b=zDaRvbd2S5/ZqRTS8KxkivDNe1HtsMNjkAJO6Vcqr/K6YGJ/ScNqkoaabJ7RPgw8GbyA 6OpgoXamzasjppOBZwGSmwR+lFyGY+D29YR4GIBbl9hP0B8TfMlxD8eXa0rFuGM7o5JWT uEmu9AKmvmUiVx2yg4RiiDYfk/8x9kzC/Iv7Ek3sSHMy+1Wi0WfCgnkxiS8WGWqtZcGg0 RXMjJi45JAqO5cymMCMjZqcM9eZT9fk7afjGciDWzd7scqNz36xunTSX3Se4GvjC7DntN vuvL4btE1+R6DxOuq/7mI6IaNN0kLsVSwrIjAr/uCwcRCvZgt2tIl4V4maNUlVTm/Pw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794563275; 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=Lye2VWkcbOLJPzpCzSxr8rD8nzn28pSDZgqknwmL318=; b=lFrvifa8ypS7CGbk34EQJfuktSpPeRi9SZmwtpbd5fvKQP5EOsIL49IACV6s/KH3DNgF bTloLlhf2znoU8o0IUrHsqfRI0S3+7hjzrhq4K/oILufG826+69AOcVkb8ubhkCCOTanh SFfdocvhKsLfwz5YoMxLGBkJAHrSiDJ9hhsCoAwiIiqyHvOW+bQRo0YV5Nh7JfoiQB6fx X4oePQFDbdp6CQJcB9ZvUHflUEUMrj5ZO6s9mQSEBlFMq0aO6KliAtuOHMemdsZMKWhnF iMUoUPzeOShkXUZwHYiHp/NMNUDidxyHPcCRa05i0rMj4gWbMl1PQVJmjmktaTncDQA== 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=AId2hsdH; 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 6C443606A333; Fri, 13 Nov 2026 09:47:55 +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=AId2hsdH 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=1794563274; b=uG8/2Om4iP6C/4AWdFPaYVmmssYFdTeQXFN9y7RpZfYNZVLIFhDC0qJSdZz4q82GQTJA +1O+Qk5qu10GeJfexgsKl3WcQHeuVMA8NrTmZaB/X8ePmoML5a++JqkR5pxnKkkGKD7e5 eyHMPKKO3KT83u7o1gh9Tzhk4lWacNlf6YDUde/rcPgW3Sw94hTJXv7ztYmJ8hdaODDvE YtpmCV8gDuUHDLya1g+iy+OQvEO8+NVkCqXzFcnpgNZN6UMeM5zawKtmxHPdkMXB6rU3J TBrsqS8CVtLhfQD17kxHwCD9jakMvkRGquYBcRp9dyaTN0dWwPQ9Z8BJ0MrxIOO//lA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794563274; 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=Lye2VWkcbOLJPzpCzSxr8rD8nzn28pSDZgqknwmL318=; b=JOja/IJJ7thQ/r/kLkxGoetclTJ4jSRD8Cb01W/EiBZgc6V26ni+Q0eKtEHe49sMa6Uk lHLLaVA/KW0axijlLKc1X62ICz+TvPKBuJsmmhZc5ysN6GVFGYoP20/+Yu9pdavEwx2XQ JH0XIyWy8O9Et4mLgyAc5aa7RUZ04e4uOs6XaiGNB35UXaA2hF0oksjLo5vOFi/JNsZwx cy+inPUzlFq+c2r4Ig74bZA0L/3LCeZg19Tsu7MieX9sZmyPmlMMooKo2YYEurXWpxsC6 9jvNIXPjBukaoqarBDpUp7chr2w1EzDEgUvfCdG2l3vEcWgTFS+XNYYZShleEU9LxZA== 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=AId2hsdH; 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 A1FFD606A321; Fri, 13 Nov 2026 09:47:53 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A1FFD606A321 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=1794563270; bh=Lye2VWkcbOLJPzpCzSxr8rD8nzn28pSDZgqknwmL318=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AId2hsdHBhcIphzpyggWxENo/TtfqEjtT30C2fjiMJPnxhzPu/zQQWdi8QlONXLb7 mtd4AZ6jQ1SOkeVFUSyr3q1Dfrs83iguOQ1Cc/T+6bHL/OZTpbGWynWMwWjV6jXzB/ Yoev+1qo8lrQxUZZbKkgI0TVuO4lWN4SRoLMv0EVt3FQRaJczRYZ2mpjZQl4M4HVzq PTVYnuZzMbn4ve8nx/l7AUKoiFm8OWiTL/yisTq5gdSwkL4XA9TYlU8T2Jt6srfBxb mNkMW4NDjgLyJOWTTDFT9P2n1zm9a+2TzDgzBfRcvX/yicOoxW3iB9e1bOacg5+xkF MxspB6nxh7pEQ== X-Received: from netfilter.org (mail-agni [217.70.190.124]) by mail.netfilter.org (Postfix) with UTF8SMTPSA id BF04E6007A; Fri, 13 Nov 2026 10:47:50 +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, Jiri Pirko <jiri@resnulli.us>, Victor Nogueira <victor@mojatatu.com>, Sashiko <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.v2.r0.20261112151659-3@mojatatu.com>