Article View: linux.kernel.netdev
Article #14612[PATCH net v4 2/3] net: neighbour: reinject a parked skb through a headerless output device
From: Jamal Hadi Salim
Date: Wed, 11 Nov 2026 15:17
Date: Wed, 11 Nov 2026 15:17
85 lines
14448 bytes
14448 bytes
The issue:
neigh_update_process_arp_queue() drains a neighbour's arp_queue and
reinjects every skb through READ_ONCE(n1->output)(n1, skb), where n1 is
the top-level neighbour re-looked-up from the skb's dst, not the neighbour
the skb was queued on. skb->dev is whatever the producer left there.
Note: skb->dev and n1->dev are not guaranteed to be equal.
When n1->dev has no header_ops, arp_constructor() and ndisc_constructor()
install neigh_direct_output(), a plain dev_queue_xmit() that transmits on
skb->dev and builds no link header. Such an output sends the skb out
whatever device skb->dev names, not out n1->dev, so a producer that
parked the skb naming a lower device has it leave without the link header
its own transmit path builds.
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. It names the slave on purpose, so that a parked skb
does not outlive the master it came from.
This half was split out of the sch_teql fix on review, so that the
neighbour restore carries its own commit log and its own Cc set.
The Fix:
Put skb->dev back to n1->dev before the output call when that device
builds no link header, so a headerless output transmits on the device the
neighbour belongs to, whatever the producer left in skb->dev.
A forward that steers the skb to another device, nft fwd ... neigh or
bpf_redirect_neigh() with explicit nexthop parameters, parks it with the
dst of the original route still attached. When the original route is
itself a headerless device this gate matches there and the skb goes back
out the original device, running its egress hook a second time. 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.
Conditions to recreate the bug:
CONFIG_NET_SCH_TEQL=m and CONFIG_VETH=y, run as root. This is the
neighbour half of the sch_teql parked-skb fix, reached once sch_teql parks
the skb naming the slave: create a veth pair, make one end a teql slave,
give the master an address and a route, flush the slave's neighbour entry
and send one packet:
ip link add v0 type veth peer name v0p
ip link set v0 up; ip link set v0p up
tc qdisc add dev v0 root teql0
ip link set teql0 up
ip addr add 10.0.0.1/24 dev teql0
ip route add 10.0.0.99/32 dev teql0
ip neigh flush dev v0
ping -I teql0 -c 1 10.0.0.99
The packet parks on v0's arp_queue. When the solicitation resolves,
neigh_update_process_arp_queue() reinjects it; without this change it
leaves v0 directly, with no link header, and never reaches the peer.
The window that frees the master, and the unload recipe that shows it,
are in the sch_teql patch.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Link: https://lore.kernel.org/netdev/20261110101908.2e64e8e9@kernel.org/
Cc: stable@vger.kernel.org
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
net/core/neighbour.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index d6e9c7c59a89..541cf699abae 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;
READ_ONCE(n1->output)(n1, skb);
if (n2)
neigh_release(n2);
--
2.34.1
Technical Details
Message-ID:
<QDISC-6HS9.v4.r0.20261111094338-2@mojatatu.com>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-361142-linux-kernel-netdev=dewy.ruReferences:
<QDISC-6HS9.v4.r0.20261111094338@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-361142-linux-kernel-netdev=dewy.ru
From: jhs@mojatatu.com (Jamal Hadi Salim)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v4 2/3] net: neighbour: reinject a parked skb through a headerless output device
Date: Wed, 11 Nov 2026 10:17:29 -0500
Organization: Usenet Network
Message-ID: <QDISC-6HS9.v4.r0.20261111094338-2@mojatatu.com>
References: <QDISC-6HS9.v4.r0.20261111094338@mojatatu.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="892483"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:8j2AlTmGhDy1Ej8glYQhITWVqgk= sha256:6A7Id8794mc3F17CZmy/58fJyrthkV3fT40Xz85iygw=
sha1:uSuqXHkCl8gdao48l2nkSm0guNI= sha256:3YpiOjEZplpWRaXg2xpA29y+8QCeSgaawJ5h9Q4D6JI=
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 A523C113F38; Wed, 11 Nov 2026 19:23:07 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.15
X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31
tests=[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 (1024-bit key)
header.d=mojatatu.com
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 9fbXN0h7ZHpQ;
Wed, 11 Nov 2026 19:22:56 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-361142-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=mojatatu.com
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
by mail.dewy.ru (Postfix) with ESMTPS id 52879113F34; Wed, 11 Nov 2026 19:22:47 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sin.lore.kernel.org (Postfix) with ESMTP id B424B120A3C; Wed, 11 Nov 2026 15:17:52 +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=1794410260;
b=T08pkn6Y348uBfoEgbLQ1Rk/mNMvaJWJIxH7Qv9SDWSX8KL2J9BYnziHMh17kksp5YEy
ANiFv8doql+n4iJzuekT/QStPvqm6m8AnXDg59cvq2IK3uRv7U/SnQdBbP/4EY2c2Duef
szjEc9YBSrsoYBuOuqIawU5k38TTKTTRB6TKakDTnaxtoRL3ErdOcqhIV7DJBQFo0tywW
2wkNBCptvmZb94jxqvai58R7/R51gSfweNKVDOz1dsye1XIdP1VjTBizcoo56hTHXBZya
ODKp5twblW/uRVWfHM4h2wHD1efbLiKfK+5LcSHl+4mu+t1naDFobX2Jb2f7crek1UQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794410260;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-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;
bh=9NkKTdy7E+fn5loOIr0xMLoCRO488mmeRzTGz2rZ+m0=;
b=WRCytlOnISZVu3ReyPuIAyNVXylzHfY0ceVQgqX/L0m/i3MlOgBhMNUtkf13kP4y3Fsq
MVRmMfYpMiTEe4kOCPIm+M3/VN7gh7roOkc1qw7BxTQ5W+BjF5h2FJIRDwf3uMD9Iz4/8
f1hp3qhQRLqJy+sUqxJWwwDqR4aEm2jWpmdeQBhLoFTm9gEcYwpsNmmaAIyLMrPzazDwR
3x4Sw783O2E5ZQwqI34mdWfCMks+bAxYecqnnFACL17/Wlu0pubhqUQHZkMFXb4VHpCB9
oCfREqJFEIo9dWhWGtT88yywljHfH8wCvGmv65Fc5n4Rkkfa/+obWGysMfserHh1yHw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=mojatatu.com header.i=@mojatatu.com header.a=rsa-sha256 header.s=google header.b="gy2kD1/w";
dmarc=none header.from=mojatatu.com;
spf=none smtp.mailfrom=mojatatu.com;
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 B9D41606A331;
Wed, 11 Nov 2026 15:17:40 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (1024-bit key) header.d=mojatatu.com header.i=@mojatatu.com header.a=rsa-sha256 header.s=google header.b=gy2kD1/w
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.173
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1794410259;
b=fe73DPOfKVSbwL/hV1kuZIpsMarCfgNbjeyBzVL4Xykvgg08LIhOb1zuEMubVM7H8uZ+
Vjikxq7ijZ3GeLGP+fSZXL8LKICxpK/+qoru1qN5N45KJh5p5jBk+OIVexepg5trzX7c5
O38fw9Uqb9lfWHwI8WEO+uty0P9oHyh+HeMUYLIGlcblz7UE8nZEiUvpIXK2Qi/e7GU+B
phJcnrUB2sAtNpughhTDrliFdJmXjuQtxXMYdKlinVCvLPR+bVgnivXxnbgkbFEsyUVpv
I1kluJOdAM0ZQ8JR6uThZ7JDVq720sSTiFixAiA6rSUQ0YC9WqKrb5B9z0MVhGAhqVw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794410259;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
Date:Message-Id:X-Mailer:In-Reply-To:References:MIME-Version:
Content-Transfer-Encoding;
bh=9NkKTdy7E+fn5loOIr0xMLoCRO488mmeRzTGz2rZ+m0=;
b=oCvkS+wdkRV+gtMc1JpTZVHXTcOGSDGuX2iydpZvROSS8QoLnWTkZJJX+dkfJMEN8qhQ
1pojVQrXpzVzaouZIYCePXowpRrRARxHZ4usxnZygIB2syoKovIccnCSJplA+inEqgdP2
L/jB2jDhrTv+Vb2S87pcAy1B4aIyJSQUelUJvBLwtRQ2zTyETixBgIQg1Ee2ZVpWwS+lH
KlEh74WYsqBjhkiI40eNzxapzOHXJbvhXs/U4RJTCS46i/JmnOkC/JlkfGrqundiE713p
oTGuLnLt0lhAi+Bdf+wZFVtWx/HwD/lIS+AbcHlVk5z8x5ctFKYu480nmLO8J7HSVXw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=none header.from=mojatatu.com;
spf=none smtp.mailfrom=mojatatu.com;
dkim=pass header.d=mojatatu.com header.i=@mojatatu.com header.a=rsa-sha256 header.s=google header.b="gy2kD1/w";
arc=none smtp.remote-ip=209.85.128.173
X-Received: from mail-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8BE1F606A887
for <netdev@vger.kernel.org>; Wed, 11 Nov 2026 15:17:39 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8BE1F606A887
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mojatatu.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=mojatatu.com
X-Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-8b31448caccso26566327b3.1
for <netdev@vger.kernel.org>; Wed, 11 Nov 2026 07:17:39 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=mojatatu.com; s=google; t=1794410258; x=1795015058; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=9NkKTdy7E+fn5loOIr0xMLoCRO488mmeRzTGz2rZ+m0=;
b=gy2kD1/w4DIhUOEdGxhot8FE5VMhvVUwaVJVxe1qDF2iqog973btkpOVJze7aMXSNJ
Ge3OeASUMNahxRXOJb0x3sFdddKEfL/Hxg8nGJOP1o9LKDB9xsXXrGHlpcilSTZYKsue
kv7lkjEYiIbt8gTaeCDhVj7sEzn3FCg2Drafc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1794410258; x=1795015058;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
:to:cc:subject:date:message-id:reply-to:content-type;
bh=9NkKTdy7E+fn5loOIr0xMLoCRO488mmeRzTGz2rZ+m0=;
b=yTYhRincNZAESKjy81PCaPYVyYm84fnV6jlP5ZHQ/RMe6xFj7eIEHeamNVn7GDDiK/
A9HMjTUOsAL7dAv07wOBvF+wDVENxb3Fx0VkqlYT02xdsUyeXgjrK0vYhIfeDOMwSI4I
w418rIVjQJYc1yIzMuJmRTmuruNM5fZqGl1Je5etI12DnM2PcTdUiJa1pZkl/xjF8OFk
+iWxdYexXdi8/nIFjCsL9MHXPTBDqTWUEXkl5q1ZOq3ispufap955OlWM+WiAl6FR+rQ
ooGPn8bTH5YBE1CSRmMGLAhmjgBpiNHBxjxjonZnn8oWPSBL3pon30tLc20hxrCiTiaQ
xfOg==
X-Gm-Message-State: APuU4Z/QAa9qbv7965b/yDY6LZq1bOO1w+EdjhaqRTJzIBXDFWPDgtj5
m9q73NqlOitp/jR+KNVk/+mw4ayjstMel8QRBjLVV2y1pdF7C/AXwCg1ST7iYFA8lxTtvWs0Cb4
Rp8M=
X-Gm-Gg: AYBFou3foH0NxJ1vxzBnQEbgHBr4w/X7r2KD0ZLZWiufGOtLsHzg/EyGoRkvwInK7BN
x8cZH7Nl2L/gTH5KEhhJLRCjEpHD3C3YLjAKHy4O/tYn/H7mjT+LgypqkODFJJzgyEA4R2kzeXb
xyQ9+eFw8cSbqqPC94ErPEFiu8S4lOn3mIjIjbcy42oQ3L1NrTJK2azGX3aZNvpxWwDFqwM1rAO
+z4BRmA0YpUxIYke7ZFQFwfjzNXdelXShpwYrSSl36o4PWfCruQlkDPlySDby/qNBUEfLuMgHFw
umHvLPwjneG+3HpAxnrawgtjwxZO5H8FUzFokstSNGOxA192u80OQFcd0euxud52R9IHv8uwZxW
w+wCiN0pAcH6/h7wmH6liyhpfBVOTkEzxQOOUSTuV9RsKYuKVKt3Pl5SIDfqGCVN5AZl4r60E52
wojRSQlDxbiOoVA+KPa3Qwd1d3msk3GVCew0CPyPiKzC4XAEwKiMZiSCoQ364wNMl3ccT276KrF
JjBfzh3qgIurQxcZXZ3axs/peq88BnrlcxMeZcFp5deTVGj8u89GctWzDkcAIbdmqock8Rum1g7
qECr4jvIBH8b1CEPi8u4BgD2wepbNcYYKN4G0F4tTOMCWlk2dI51VKQfYZEmrNCJjurmFqdhcfJ
wTRUpx/3JXVSNGg==
X-Received: by 2002:a05:690c:7482:b0:8b0:aba3:a3e2 with SMTP id 00721157ae682-8b3a80803bdmr21116337b3.37.1794410258561;
Wed, 11 Nov 2026 07:17:38 -0800 (PST)
X-Received: from localhost.localdomain ([64.203.83.2])
by smtp.gmail.com with ESMTPSA id 00721157ae682-8b393409120sm46499187b3.27.2026.11.11.07.17.36
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 11 Nov 2026 07:17:38 -0800 (PST)
X-Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
David Ahern <dsahern@kernel.org>,
Ido Schimmel <idosch@nvidia.com>,
Victor Nogueira <victor@mojatatu.com>,
Jiri Pirko <jiri@resnulli.us>,
"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>,
bpf@vger.kernel.org,
stable@vger.kernel.org
X-Mailer: git-send-email 2.34.1
X-In-Reply-To: <QDISC-6HS9.v4.r0.20261111094338@mojatatu.com>
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