Article View: linux.kernel.netdev
Article #19144[PATCH net v6 0/3] net/sched: sch_teql: keep the transmit path's skb geometry and device lifetime intact
From: Jamal Hadi Salim
Date: Thu, 19 Nov 2026 12:40
Date: Thu, 19 Nov 2026 12:40
105 lines
15767 bytes
15767 bytes
Three pre-existing defects on the teql transmit path, all around
teql_master_xmit() -> teql_resolve(), plus the core helper they depend on
all derived from sashiko reports.
Patch 1 makes the headroom private before the neighbour can write or queue
the skb, and pulls back only the header that slave added, so a
header-cloned skb is not corrupted and a userspace-supplied link header
survives a retry.
Patch 2 restores skb->dev at the arp-queue reinjection point when the
neighbour's device builds no link header. It is the neighbour half of the
version 3 patch 2, split out on review so it gets its own commit
log and its own Cc set; requested by Jakub.
Patch 3 moves skb->dev = slave ahead of teql_resolve() so a skb parked on a
slave's neighbour arp_queue names the device whose neighbour took it, and
so cannot outlive the master it came from. With patch 2 in place it is
reinjected through the master and leaves with a link header. Its commit
log carries the KASAN report the unfixed kernel prints when that queue is
drained.
Patch 3 is a follow-up to commit dc4b95b8fee9 ("net/sched: sch_teql:
restore skb->dev on the slave failure path") by Victor. Patch 1 is the
same commit's sibling on the successful-transmit path.
To prempt the sashikos:
- The pre-existing teql issues reported alongside this series are fixed
separately. For "the lower-qdisc drop use-after-free" see:
https://lore.kernel.org/netdev/QDISC-Y0BY.v2.r0.20261024060625-2@mojatatu.com/
- For the pre-existing consumer nft/bpf complaint see:
https://lore.kernel.org/netdev/CORE-9NOG.v1.r0.20261111073528@mojatatu.com/
Note: nft/bpf combination _has never worked_: it is a producer-side
mismatch on two separate entry points, not a regression of anything here -
hence the net-next target.
Hope the sashikos read these and dont complain again about those issues.
Note also: part of the testing of patch 2 runs for packets that reach
neigh_xmit() from nft's `fwd ... neigh` statement, or from
bpf_redirect_neigh() with explicit nexthop parameters. Both keep the
route's dst attached while replacing skb->dev, so the neighbour that
queues the packet is not the one the dst names.
Changes v5 -> v6:
- patch 1 closes the finding Sashiko (nipa) raised on the v5 posting. The
retry no longer strips whatever offset it happens to find: every attempt
starts from the network header, as neigh_resolve_output() does, so an skb
that arrives with link-layer bytes in front of its network header is
given one link header rather than a second one. The length is recorded
as the offset the neighbour built, so only what this slave added is
pulled back on retry. Considered comments from Sashiko (nipa).
- patches 2 and 3 keep their code, and their commit logs now name the
cross-patch dependencies: patch 2 says which patch parks the skb it
handles, and patch 3 names the patch 2 prerequisite and the ICMP error
routing the skb->dev move also changes. Considered comments from
Sashiko (nipa).
Changes v4 -> v5:
- patch 1 closes the finding Sashiko (nipa) raised on the v4 posting. The
head is unshared before neigh_event_send(), so a skb parked on the
slave's neighbour arp_queue is already private when that queue is
drained and the neighbour writes the link header into it. The retry
strip fix is unchanged. Considered comments from Sashiko (nipa).
- patches 2 and 3 are unchanged; this resend is for patch 1.
- patch 2 adds Kuniyuki Iwashima in its Cc set (nipa CI).
Changes v3 -> v4:
- patch 1, no code changes. Reviewed-by from Simon Horman stays, and a
Link to the review of the v3 posting is added.
- patch 2 is new: the net/core/neighbour.c hunk of the v3 patch 2 is split
out into its own fix, with the neighbour maintainers Cc'd. Asked for on
the v3 posting by Jakub.
- patch 3 is the v3 patch 2 with that hunk removed; the sch_teql change is
unchanged in approach. Reviewed-by from Simon Horman stays.
Changes v2 -> v3:
- patch 1, no code changes.
- patch 2 corrects the conditions to recreate the bug: reaching a freed
master needs sch_teql built as a module, the slave qdisc removed and the
module unloaded while the skb still waits. The message now says which
part of it reproduces without the unload, and names the neighbour failure
path that drains the same parked skb. Considered comments from
Sashiko (nipa).
Changes v1 -> v2:
- patch 1, no code changes.
- patch 2 limits the reinjection restore to a top-level neighbour whose
device has no header_ops, the shaper/eql/sch_teql class. Commit message
also describes how a master is freed. Considered comments from
Sashiko (nipa) and Sashiko (gemini).
Jamal Hadi Salim (3):
net/sched: sch_teql: unshare the header before writing and fix retry
strip
net: neighbour: reinject a parked skb through a headerless output
device
net/sched: sch_teql: keep skb->dev consistent on the arp-queue path
net/core/neighbour.c | 3 +++
net/sched/sch_teql.c | 27 +++++++++++++++++++++------
2 files changed, 29 insertions(+), 6 deletions(-)
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Technical Details
Message-ID:
<QDISC-6HS9.v6.r0.20261119070330@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-367011-linux-kernel-netdev=dewy.ruShow 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-367011-linux-kernel-netdev=dewy.ru
From: jhs@mojatatu.com (Jamal Hadi Salim)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v6 0/3] net/sched: sch_teql: keep the transmit path's skb geometry and device lifetime intact
Date: Thu, 19 Nov 2026 07:40:22 -0500
Organization: Usenet Network
Message-ID: <QDISC-6HS9.v6.r0.20261119070330@mojatatu.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="2871776"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:8+nGuVb3HPfrAcGI7O97Aiy8RQA= sha256:DdRIAaEW4UE2jM6WxnkLvf+giadOxMjF1AvXJK6/a4k=
sha1:TRp49oBgl2M8+bUtDqsP0mau6Oo= sha256:K4QLSL1zdpDKkxLAxLVgUYhOmgou9a/iyhy3GDlOiqM=
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 8D5DD115645; Thu, 19 Nov 2026 15:41:01 +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 O9ATnCn3SWCH;
Thu, 19 Nov 2026 15:40:55 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-367011-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id E4A57115594; Thu, 19 Nov 2026 15:40: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 8BCACC9770; Thu, 19 Nov 2026 12:40:35 +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=1795092033;
b=Q/ho3OYgiirH9OETYVidWrygJwDdWdrGNimkzXKl1o+Ndcb21sYKXjJJW8O2mOUm5thd
lqM8mDAVUX75hemNpCgABpcNtfyxuUfFPfhNtfrrrGLa5DHGRERuv1jxs6jw9hKEBjUal
ghONvgH0RA7hixJ8jV3b6ynoEO3d+WB0UiTHrhd4AofdMtKqmPJzFSVqJNi7t/uBIGgVf
rA5hP2C5xTrZn/dCA2qXT/JLYs01NccoWbB2HgLcbiPSvCy9wfRLGigNNqeLh8XRFEw4e
GaT14kpd3R2Py3+l7k/7WVV34n5t1wSZiFQS3g+m+XSniDgThkgucgi5ruKdxXhOUUQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795092033;
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:X-Mailing-List:
List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
bh=B+OXNLr0kdKkrvvm/CcRnGXdIGMgDEGRb/zrjUPqAT4=;
b=iwiJiguhAfPMC9CviV0ZBg6a/ZqwpKI5hprY4NZ2iyx7z2a+IDPGWPwyjMY6vrARkj6V
ciVCfMbzCJHPoEO5PToOiAj/+gZ0lxlF/CGYvb9O/hKs/sWkUfE1sT1hEjCBMg018GAj3
9Oo8DdFSYecjqrkkN3jDVwNEomEBk0exOyamRB6kTC+af6CPh+WwPKcL5CbWO8ojDbV8d
8U2Tkxf+7jokVgKZ7OHZHTXJREF1K5o3oPjttQecJH32qio0XOITgaBcx9TOekbzD91YV
jtnMWivJuDyGCBTDtemyrr/9AesnJtkbSk+U76F/yO92cRvfKDY+y22DElsTlbQYe/A==
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=HUQzosz2;
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 D5293606A33A;
Thu, 19 Nov 2026 12:40:33 +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=HUQzosz2
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.171
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795092033;
b=Km4GpykOBrVIOv+DI95OQcKAfN7g1/O2OudNCo6str4COg90sSNchScihFyYXYt1wyze
8iTYs8x4ImRHqvgYpsPMvqzHdoN6omFbLXBL9Dk1+GZGpr7JZO49VvwNPvHVcOrmgqVFI
cTY5S7kWw9YMk8IcRSmsMcVWJ9Su8sGSU3IbhXmtR29ElBpgjQp52m1UNl1e4FXfkmeot
TfmgV1vVGzA/NN8h6rY5yYr0Q/g4oFfLFVKuWTP6z4D9VrJNI3mK/HpAtHgfkslQO8Qu2
CLOkTrqqE6o6s3am13pufHEmbZlkthnyH4s2tXi/nxJZC3MV/aRtVmYTgTwNJWTd/SQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795092033;
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:MIME-Version:Content-Transfer-Encoding;
bh=B+OXNLr0kdKkrvvm/CcRnGXdIGMgDEGRb/zrjUPqAT4=;
b=DS8zqqODsdhWegnpn3WdhXN1acN70jACyLqWvtQvEm8q+Sx8Lx1/pgv/EPWYzQPZ24gN
hGKsic/ZYv7un46NwIZl0JTfjZLxCqFtyYS/L8LJSNvvPFyZBat1/4ovvI/WxpZpvXyQ6
dCIybNf3+6eU4NELvfZBcKu1guxCE0XX8fKonz0yQQ3690+XywaMjhXISwsisIPG+Gtf9
GqA/Eezp0lB1xWDdLrTHtgebdLQnkP2SHBG3duXPQhqrJ3cS43RIEUgfHRhw0u3ci+H6V
Ee9JsSRPsS+bZIFeBaLLZR7NfmDgy4qAn7EeHhUIzQ6FJ8FjDpjyhIyliNKDBqNHivQ==
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=HUQzosz2;
arc=none smtp.remote-ip=209.85.160.171
X-Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171])
(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 0F480606A320
for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 12:40:31 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0F480606A320
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-qt1-f171.google.com with SMTP id d75a77b69052e-55d2f5f1e26so22193711cf.3
for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 04:40:31 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=mojatatu.com; s=google; t=1795092031; x=1795696831; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=B+OXNLr0kdKkrvvm/CcRnGXdIGMgDEGRb/zrjUPqAT4=;
b=HUQzosz2FBP7Ozg3wh92TixJNdi76eZbRVeBDr9KL1inpC09+GZn7N50LzY73CrlRC
nh/FMBhWjdHpER1JYb1oyIcsagvYrGr904tjFODs9sPS8LTkrvkw7IzUFvo++D8ejPoc
ANbpimzCQhXkJChEAhWLaQoKbrKkvlIVyluUc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795092031; x=1795696831;
h=content-transfer-encoding:mime-version: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=B+OXNLr0kdKkrvvm/CcRnGXdIGMgDEGRb/zrjUPqAT4=;
b=KoapbDuvhPoxxWcv7lSccrMvZOuxcqTASBKk3ENT+EWKEQHnP4ADCISwtDBiFDyMx1
AqF5XRuh1T55S8N2Xgicif4MhVnt6duC9+vVodcdgBt044X8a1yayU/VpldQ6/1ssktX
cvFTJZieZqHCRSSe5NA6JOKStaF4nG/7Y/zw2tiou6rygGifyQzdYxqQJRhejl3UT1Q0
5CaNXmUkz0IAgJDHx4KKzt7wI4pVviaB0dpSK02RkpdOrsFRJmwNMGcWC9+tuFd+xMhf
yjVpPl+2Q35x6v2/O62/HfFk6D540CjnoLbWnJZzFCbzmSjR8KLrKhfgDeAKTLDQ5YQL
4n1g==
X-Gm-Message-State: APuU4Z/FXT/lWTMszD/be2IkDLhAoN4W6FneddXUyd2wD0OfQu5FovcA
jW5eYWWLQLvE9TZIslK5KIvG/zlI+0TvcTCHJHvtlSUR/yd0MV+qhpUUGC6WcXaU1msF6C2Ev0q
KKl0=
X-Gm-Gg: AYBFou11M77Xr/+ewUUfsUlTbC8YPt8qikaMNAAUnotQB8eSahOwqPexocfHYm0mQgw
oD+/8diXDBrUaNMdRRFjQNf7UdA/Q3x3Gli3IccGcnryWyx82TkNpPaGQClTyg7LFEY1f1dKKZB
olGuvLpCu6mLF+cf2DmMPXtH7fEvA6iMjsteaMLFJT1LYTyCdlBOzFPFr3ghIx7cfd1CHypXa34
maQ0hAP0ulmwwDxfWXO05W2YGE+1zLAeGWqS56o8QXecUABeLYiSEHp05QTNzKXRVA5oNEd03za
FO3gezuGJZk0fiKGPmUMZO8eO65gLWYDRUn/7QrGiuo3Od6IXVxcHsWpJCFelqhHmYsBdCY+Zk9
7UK00NjoNY/d3byTVhlzsDKDWJZGGx9NroJOcnDZlvQrRfni8vb4QL/p5g/dWrwXf6uIzxRVcOg
UUjlHIl6N1DUKxVzKIvHUGPty5sfpJX6GQjECYbZYwOX0Bj5o1yHJ7HrlCL/QLBriHPlQyDQsiS
zH6J6ztZK8/luWVdDWLgQEFd0kVjXckA/3yCxZB+gl3xxjJ3QG5zOAnnavJC/uyYoY6aWcG1VnN
CIXS5f2Z8aS2849moWnhtOA5Tfk6wmwNl5B3GW948E9TRj2uQyd3SzzZ3nouRGvGbdUDXYuuVTk
=
X-Received: by 2002:a05:622a:598d:b0:55c:840:1307 with SMTP id d75a77b69052e-55d5a62fbb3mr85938531cf.20.1795092030871;
Thu, 19 Nov 2026 04:40:30 -0800 (PST)
X-Received: from mbili.waya ([64.203.83.2])
by smtp.gmail.com with ESMTPSA id d75a77b69052e-55d66b75823sm22370191cf.13.2026.11.19.04.40.28
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 19 Nov 2026 04:40:29 -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,
sashiko-bot@kernel.org
X-Mailer: git-send-email 2.34.1
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