🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17049

[PATCH net v5 2/3] net: neighbour: reinject a parked skb through a headerless output device

#17049
From: Jamal Hadi Salim
Date: Mon, 16 Nov 2026 10:36
85 lines
14222 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..1b556fa17c57 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.v5.r0.20261116052927-2@mojatatu.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer04.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364197-linux-kernel-netdev=dewy.ru
References: <QDISC-6HS9.v5.r0.20261116052927@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!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer04.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364197-linux-kernel-netdev=dewy.ru
From: jhs@mojatatu.com (Jamal Hadi Salim)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v5 2/3] net: neighbour: reinject a parked skb through a headerless output device
Date: Mon, 16 Nov 2026 05:36:42 -0500
Organization: Usenet Network
Message-ID: <QDISC-6HS9.v5.r0.20261116052927-2@mojatatu.com>
References: <QDISC-6HS9.v5.r0.20261116052927@mojatatu.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="2035779"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:WF0PpnXWxxIEn7NKwJakG4oGj6A= sha256:XCSyMEwr3kV6AYEU5YE+IvjDMYc3/7UznLr/6EWtBcY= sha1:cIJiym/tkQIZluXkTJiUgkwyMeU= sha256:qb+D4Xo7vOJ7TdaNa9UMh4IeuH9798+zLZqGqwOOgRI=
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 24B59114B9F; Mon, 16 Nov 2026 13:37:21 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 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] 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 2ZlJQjgjK90k; Mon, 16 Nov 2026 13:37:16 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-364197-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 5EDD7114B9D; Mon, 16 Nov 2026 13:37:07 +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 B3D0A2B524; Mon, 16 Nov 2026 10:37:02 +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=1794825415; b=jrH0OLxv45xro1PiFiC7lpLgjhWsVTj80tO/5TSIejBF8GADfXHlHdqHajG6YTvICInt V/Wo++vxYk466AdXfr4suKOxl8Ft4y75AhcAgZ7pMe9pv3rUco2Ve1DC3CFCkS4sl+xnQ LtwHWkckxA9btTk4k8c7/HoLBtYNxoVujbGH5UaEXetZi9GF+uFzSnfG3DUpPV3Lqa8L4 9RxdQWnl1TPol7SM9CsawiTKFzEW+/P4kqE5bhW7ZO7FDR/+9+5rHahxXETBP1ztnRtRH kccl+9oh3NJs6NOiJI4wCQXlYof8swR296cIKxQs5LchY8zakyKyMrnPN3cm/BjJ32Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794825415; 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=opkasNgH5N2ElWKTLtDlU79vyZanUWteaYR8uJXKCIE=; b=OQQjepdPSNBovRmVRyArGldzO8WMXcjImPY3WIvF3DrB4Lg2FkHb7qmDXs5S5HVyQ537 EFGCvnbR/tM8cP1rortasIbnZ23G2FjGy2zaDUlFGchV+P6R9DBRHlf1mDoEVM3X+Y8je gUhA1olybVXCuJKDlOpMxT952EOZ9lXlZ7IMA3aBGj9dodcX0SUseVnIM30ZNBu9SA9Xc ZSnkq2YJzuRM8XVGwDI/+mAf9Ojp0mGzw0rcEHIUjqkedvVf0WLz4YiGZJAih/Ap5mBqO 9CW4TDFWY0LiXfIPsosxXfBlDAgbLehkDnegwJMMmojyb69NNaSVMAArzq/yjjPKnww==
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=qNy1jVqW; 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 09EEA606A8A8; Mon, 16 Nov 2026 10:36:55 +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=qNy1jVqW
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.53
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794825414; b=siWMFJU6BTU6qT80lCwap/pw48J5LBSxthZlhZXboVQ3Of3StTgyplMcIoFdvdlB90gx imQgQA+pSkka/F3NcQa0892SF46fEVgX5o+oBmBkQ78vLuJk7P/xK37DfJdh+EGrBj9iM APBetzQcWMwh/9wrGlApAjuG3PkzMAkdhQ2g2vuDhv8+CEL5lKyHPUYEv5saadANIYDCC HAn3yklau5SOtQolTlHg2evTjSyd2vlGLAmCDzDpLA7FCXH1wSfCn5UF8gUHSwy7a+Bh4 VcsrkQX/m/g4rHBkYsndDqgX0oGg8b+7fvDOixxaNhrFUQsRygOTr71geTN91bncdsg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794825414; 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=opkasNgH5N2ElWKTLtDlU79vyZanUWteaYR8uJXKCIE=; b=z3SKlUty5QefP8vR0IQ98OwS91sL+6n8KUMddibifYW4u3pzZoANG/w3RwQw5gZRpu7n 3v91SR1LXuw6gRcqC7qgALa/hSp/AUgprhSPrXmCtHW5cDS63DJ1TRRWqCv0/yM/YaK+m LfQ0ay3pHipSoqy2Wv5AlNgfk2OmeWkXXP+iv+w4I9Ez+d7BaXRwMS3JtOF1eir1wCdIS OS4xb5zd3COChyfUXODM6IgWJhlas7oqgcCx19lIOvaB5CguU51HdTeWSPq/9yl1klJhE ZLW67ke/YYqdjIw6qiVvnFH5TTt8ccirdGN/q5zrDN7/ZzdE8swR5c8Inq61+tjmwcg==
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=qNy1jVqW; arc=none smtp.remote-ip=209.85.219.53
X-Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (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 563AA606A335 for <netdev@vger.kernel.org>; Mon, 16 Nov 2026 10:36:53 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 563AA606A335
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-qv1-f53.google.com with SMTP id 6a1803df08f44-91ea0c05c92so48004466d6.0 for <netdev@vger.kernel.org>; Mon, 16 Nov 2026 02:36:53 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu.com; s=google; t=1794825412; x=1795430212; 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=opkasNgH5N2ElWKTLtDlU79vyZanUWteaYR8uJXKCIE=; b=qNy1jVqW6L9/5zG4gg7sEdmDaV5qrCkIrOMT60lMGphvhx75VTvRFFRnCXrKjWR2Zv TBRLQ5q67oU4GX5Ux67P/OHxvbvP9xVTZsWlnyJHyASSZAToHpFGFehpZFvDNdClwGNx n7SfBm+L2DGwfTH9oyOf5ZdA/wdkH0XydmsRI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794825412; x=1795430212; 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=opkasNgH5N2ElWKTLtDlU79vyZanUWteaYR8uJXKCIE=; b=i5YBGElToy4QicPCWlrV0lqwv3n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rZP6oxpr3DgmTPCUPO8z2dYgUB4GMkrocmRWSGKjVVDGWs5ag/o5X/4d7+PM =
X-Received: by 2002:a05:622a:58cd:b0:535:a5fb:67fd with SMTP id d75a77b69052e-55aca05b3aamr157894831cf.73.1794825412136; Mon, 16 Nov 2026 02:36:52 -0800 (PST)
X-Received: from mbili.waya ([64.203.83.2]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-55ad14f1ecasm77778651cf.24.2026.11.16.02.36.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2026 02:36:51 -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>, Kuniyuki Iwashima <kuniyu@google.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.v5.r0.20261116052927@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
X-Received-Bytes: 13936