Article View: linux.kernel.netdev
Article #19100Re: [PATCH net v5 2/3] net: neighbour: reinject a parked skb through a headerless output device
From: netdev-bot+sashiko
Date: Thu, 19 Nov 2026 10:38
Date: Thu, 19 Nov 2026 10:38
159 lines
14252 bytes
14252 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 ยท High: 0 ยท Medium: 1 (1) ยท Low: 1
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] New regression in neigh_update_process_arp_queue()
(net/core/neighbour.c:1343-1345).
- [Low] The commit message describes sch_teql as parking the skb "naming
the slave", with skb->dev differing from n1->dev.
Pre-existing issues:
- [Medium] neigh_update_process_arp_queue() re-homes skb->dev only when
n1->dev has no header_ops.
--
net: neighbour: reinject a parked skb through a headerless output device
This patch changes neigh_update_process_arp_queue() so that skb->dev is
set to n1->dev before n1->output is called, when n1->dev has no
header_ops. With that, neigh_direct_output() transmits on the device the
neighbour belongs to, not on whatever device the producer left in
skb->dev. The motivating producer is sch_teql, which parks skbs on the
slave's neighbour.
Link: https://lore.kernel.org/netdev/20261110101908.2e64e8e9@kernel.org/
> sch_teql is the producer that hits this: it parks the skb on the slave's
> neighbour while the top-level neighbour is the master's, so skb->dev and
> n1->dev differ and the reinjection has to come back through the master to
> leave with a header.
[Severity: Low]
Is this accurate for the tree this patch applies to?
At this commit, teql_master_xmit() sets skb->dev = slave only inside
case 0, right before netdev_start_xmit(). It then restores skb->dev = dev
at the end of each iteration. So the skb that __teql_resolve() parks via
neigh_event_send() still names the master, and n1->dev == skb->dev.
That makes the new assignment a no-op for teql at this commit, and the
"Conditions to recreate the bug" recipe does not reproduce on this commit
alone.
The last patch in the series, "net/sched: sch_teql: keep skb->dev
consistent on the arp-queue path", moves skb->dev = slave ahead of
teql_resolve(). Its message says this neighbour change has to be applied
first, so the ordering is fine.
This patch carries Fixes: and Cc: stable. Could the message name the
sch_teql patch it depends on, and say that the behaviour it describes
only exists once that patch is applied? The phrase "reached once sch_teql
parks the skb naming the slave" hints at this, but it is easy to miss.
> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
> index d6e9c7c59a892..1b556fa17c57c 100644
> --- a/net/core/neighbour.c
> +++ b/net/core/neighbour.c
> @@ -1339,6 +1339,9 @@ static void neigh_update_process_arp_queue(struct neighbour *neigh)
> if (n2)
> n1 = n2;
> }
> + /* headerless output transmits on skb->dev, not n1->dev */
> + if (!n1->dev->header_ops)
> + skb->dev = n1->dev;
[Severity: Medium]
Can this gate send nft fwd ... neigh and bpf_redirect_neigh() skbs back
through the original device's egress path?
nft_fwd_neigh_eval() in net/netfilter/nft_fwd_netdev.c is allowed on
NF_NETDEV_EGRESS. It decrements the TTL or hop_limit and then does:
skb->dev = dev;
skb_clear_tstamp(skb);
nf_dev_xmit_recursion_inc();
neigh_xmit(neigh_table, dev, addr, skb);
It does not drop the dst of the original route first.
bpf_out_neigh_v4() and bpf_out_neigh_v6() in net/core/filter.c do the
same when explicit nexthop parameters are passed. The dst is only
replaced in the !nh branch of __bpf_redirect_neigh_v4/v6().
If the neighbour of the target device B is unresolved, the skb is parked
on B's arp_queue with the dst of the original device A still attached.
When B resolves:
neigh_update_process_arp_queue()
n2 = dst_neigh_lookup_skb(dst, skb); /* A's neighbour */
if (!n1->dev->header_ops) /* A is ppp, p2p GRE, teql */
skb->dev = n1->dev; /* skb->dev goes from B to A */
READ_ONCE(n1->output)(n1, skb); /* neigh_direct_output() */
dev_queue_xmit(skb); /* A's qdisc, nf/tc egress */
The skb then goes through A's qdisc, netfilter egress and tc egress a
second time:
- nft fwd neigh decrements the TTL again, so packets that arrive with
ttl == 2 are now dropped.
- Counters, limits and quotas are charged twice.
- Non-idempotent rules (mark-guarded, an exhausted limit or quota,
numgen) can let the packet leave on A, the device the redirect was
meant to steer around.
Before this patch these skbs left B without a link header, which was
also broken. Running A's egress hooks a second time is new, though.
The commit message acknowledges this:
Those forwards supply their own device and nexthop and do not consult
the retained dst, so dropping it at those two sites is where that is
fixed; that is a separate change to the producers.
That change does not appear to be part of this series. The last patch,
"net/sched: sch_teql: keep skb->dev consistent on the arp-queue path",
only touches sch_teql.c.
Since this patch is tagged for stable, could the dst drop in
nft_fwd_neigh_eval() and bpf_out_neigh_v4/v6() go into the same series,
ordered ahead of this change?
> READ_ONCE(n1->output)(n1, skb);
[Severity: Medium]
This isn't a bug introduced by this patch, but the same mismatch between
skb->dev and n1->dev remains when n1->dev does have header_ops.
neigh_resolve_output() and neigh_connected_output() build the header
from neigh->dev and then transmit on skb->dev:
err = dev_hard_header(skb, dev, ntohs(skb->protocol),
neigh->ha, NULL, skb->len);
...
rc = dev_queue_xmit(skb);
Take an nft fwd neigh redirect, or bpf_redirect_neigh() with nh, from
Ethernet A to Ethernet B. Would the frames queued while B resolves leave
B carrying A's source and next-hop MACs?
Re-homing skb->dev unconditionally here would be wrong for those
producers. This case would probably also be fixed by the producer-side
dst drop that the commit message defers.
> if (n2)
> neigh_release(n2);
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/QDISC-6HS9.v5.r0.20261116052927%40mojatatu.com
Technical Details
Message-ID:
<179508471960.3136.3982985100644358215@kernel.org>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-366945-linux-kernel-netdev=dewy.ruReferences:
<QDISC-6HS9.v5.r0.20261116052927-2@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-366945-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v5 2/3] net: neighbour: reinject a parked skb through a headerless output device Date: Thu, 19 Nov 2026 10:38:39 +0000 Organization: Usenet Network Message-ID: <179508471960.3136.3982985100644358215@kernel.org> References: <QDISC-6HS9.v5.r0.20261116052927-2@mojatatu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2850099"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:48tw7eupo3kxJF/OvcidtS9yw0g= sha256:PmRK80xR6MTVQJr8x/Zu8D/NCQcmXawMV/11FqvYIgE= sha1:QXB/NZW47G6K7JIouo8aIPbZYBw= sha256:xNVM8a7ls4iV4D2J+J49vsfkcsfoqLVU6nPi4amoHVY= 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 AE82C1155C2; Thu, 19 Nov 2026 13:39:00 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, 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, URIBL_BLOCKED=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 EwYf4Ga87VAs; Thu, 19 Nov 2026 13:38: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-366945-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id F419A1155B9; Thu, 19 Nov 2026 13:38: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 293C6187B3A; Thu, 19 Nov 2026 10:38:42 +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=1795084721; b=OnJ/DQx+FfYCrK0L0uj1SSW0gbarEJDZ/gZYH7UxAOLrmD9jruPBA/H8U5izXVQqKZ/2 d9jBQsSIoAGWQyirKZR3KqrrgiZB6tedkYIbNxJ5V+t5JyN8o7ksG9GYnvWycvzOFiuO9 FHoPPIhtRnJMvv9NYbcyhpluKQOjYqmyPqnhMbAArL87yhJK3j/mVOkVd38XKpjs/sai/ piaR3fEsibDI9oIRp0Bv0t9J+FuZWCHWJtrf+GAO9TojL0uBJL+T2travQpGoX86o18x1 EGFO1HZEqVSLV872pqrcUf0BQicsNqj8WzY/b46+1OnQVw/hBtEc/rwo/w14H417YYg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795084721; 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=Er7R+lRdSvopXynFBt+niPP1ZQkZ289VWaNWEImXUo8=; b=RfOvIr6vOrQGp8xfIT6zZ1ucV5y5MnrFHqpnelFxHbcupkCpKkNYtoEWhMyxxqBc7X1d z+cJPX1xp9GMj/UqJZK1N2GFz5T3HVVItq89JE+/9Sc3GTKdcmrW8bk2BwTYpmWlv21Av fomBnNzqmcCmh/boohdkuvIxTRItDpEJ5zczN3trPwW0nNjPvs9r9bXB/ibkcPSMoI4cj nIymhNK08WhQJFCwTRsQJVQr5PYXoV2vnf+vpqgwoKDMR62yhf4ENeAJcEK5eQ9wbhu1X gWmyB0lW6Ot7AcDYkxW98TH+vk5Z4jMFIV0S2xi7wc6JMjtWKoFPRz4znE1QKXcSVzA== 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=LTcNsa2x; 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 8E5C5606A330; Thu, 19 Nov 2026 10:38:41 +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=LTcNsa2x 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=1795084720; b=OEWbDRqRIp+DMexgWJQvQ0tt/r3iJIgtNBGpjnseJcUyPNgJODjdNsXNcqOeeh9BGHv8 He8/4Y1XqqG4f1+DrERR+EoRl7NSOS+bZfsBMdQ2RZNpM7CUUnTz6eHyZ8Ad7f1fAVAJ7 6wj4WdOmgsTkGdyD1gwxyuyZ7+mDsutPv1EHxEmLhDCTldZ5Jg9Sauttr5wBX0IvQw4I/ v1rw4PXBBC5+66ECAvndzOKxviBBCwJs1KnRZYLquvuBk17i2eiqkY7Ic6oA2/EQjtxdB h9wTA+St19LUf82x7RXinFWvXOOCF3i8tZh/d0MQpLjs+d13rgXHel434676eeHV49w== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795084720; 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=Er7R+lRdSvopXynFBt+niPP1ZQkZ289VWaNWEImXUo8=; b=b7IpRHX6wWCjcid34Q0QyMUibwSnMN6aEa1eGX8xED3C0vJiVpuSuDLVjGsk3d0Jojwg 5SIKFaAONebzJM6TZD2fRELJj56K0AEne4pA28Ik1EMzCKa2EslhhjPC/FC2et8UOB/WX Z1nlyhvtlsKgqHTVBwV5jVH154/r+fS0Oz++1FTOOUNs2S5CEPsgjNS4ogKUgVQcZX9Si iJRvz4WXkba+y3Ij/hrHlxA4UWhgLituIi4f91/jewBXMwYM5nNjwY6wimUJv2SpRZSFs +iHhXH3azC05AvhgBHwed3bBmmBgLs2hPcMgbKk0aImmoGsm+/AS7pXzv3CUjHZV1kw== 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=LTcNsa2x; 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 AE0ED606A320; Thu, 19 Nov 2026 10:38:40 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05BEF1F000C5; Thu, 19 Nov 2026 10:38:39 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795084720; bh=Er7R+lRdSvopXynFBt+niPP1ZQkZ289VWaNWEImXUo8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=LTcNsa2xJeJdejCs0dQTmZ1f78J583KlW8GI/67N4fglwoQstvomBrqKX7CZNaOCa rRlQY1zBnO2tRWffnD8kKQLuf3saef3AgX2R0jiua6mj6O53xCoVzVbZcqoxcTENql zOIBkBfsP3kgdnEuCKKUxk5bghAU2nYsTttbZwdDkppFjKge74ixBv0n9p+M6N+6nR a77i8BNHjFt6Py3Cs90FdD9CvrhC6CpJS9qSLaUbml98p2GnQILt1PwnRZRlGP4TMt 4qAGh2Klt2XsUe1CJRLNO3zAyp755Ju9e9F8pUQNuTubtGv8gblMn6rNYNJ9LnXcmI fFwkX9D4aPiRg== X-Cc: netdev@vger.kernel.org, victor@mojatatu.com, jiri@resnulli.us, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, stable@vger.kernel.org, sashiko-bot@kernel.org X-In-Reply-To: <QDISC-6HS9.v5.r0.20261116052927-2@mojatatu.com> X-sashiko-severity: Medium 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