🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17047

[PATCH net v5 0/3] net/sched: sch_teql: keep the transmit path's skb geometry and device lifetime intact

#17047
From: Jamal Hadi Salim
Date: Mon, 16 Nov 2026 10:36
91 lines
14928 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 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, 24 insertions(+), 6 deletions(-)

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Technical Details
Message-ID: <QDISC-6HS9.v5.r0.20261116052927@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-364195-linux-kernel-netdev=dewy.ru

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-364195-linux-kernel-netdev=dewy.ru
From: jhs@mojatatu.com (Jamal Hadi Salim)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v5 0/3] net/sched: sch_teql: keep the transmit path's skb geometry and device lifetime intact
Date: Mon, 16 Nov 2026 05:36:40 -0500
Organization: Usenet Network
Message-ID: <QDISC-6HS9.v5.r0.20261116052927@mojatatu.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2035639"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:cWV4pouph7SPb+ezahxCzcL7970= sha256:9q1jSgilW7aXjW8rmOfFwvrFFS6FruWveGTN0UoHyPc=
	sha1:4RjijEGtart2NotWfZr1GdS3les= sha256:WujQIlovKymfLH7OvTAfeEzs8apWkJduO98RCjCYINw=
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 15D36114B9D; Mon, 16 Nov 2026 13:37:07 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.151
X-Spam-Status: No, score=-3.151 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]
	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 MEesFLPFKqfw;
	Mon, 16 Nov 2026 13:37:03 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-364195-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id CC771114B98; Mon, 16 Nov 2026 13:36:54 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 3AD716027BA; Mon, 16 Nov 2026 10:36:54 +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=1794825411;
	b=svBsJw/BwzqDVF2uMAc1cW3Y3uzx6H9rPDlFeglfDrSJfheStJqI5Qxk+ZuRjQrg+QOf
	 7/BbaEiCHk5iEdlpkYG3MT8dFm+fxH4FlPtBRDTsY/+EWBspc9HV/gRFWlqpocpDSRP3Q
	 PjmFUpNoJzZMc9xyhTvLh0rAo/3vCvwWifoV7p8iAF9gBCtr3esLyg+LeeNHdTU7gk+un
	 Pb5HeZLYPPN3pCgoTs1XOfAs05wHuWsgOEh3UI0q7t7tGa9YX0MrnCkdsisbABg/1GFAK
	 7VyCHxLaGcAnpsj2qCjDH1100QPckG0dVNLYhhK7sVmPtuFZ70X9J+6L8X7d09TfprQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794825411;
	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=hrslb7xwY/P3caxQHjfg0Zlzk+SkRY2D0gWn0IfeX6Y=;
	b=LfI1Ostu+QxLAOYmcnVQ9vy0H5p1a0XFF+LRWZJ2BbwegbEKKBGP9vuJTP/a1AHt/HQz
	 IF9wHhDjVMfNIlu53LFw9vWwiZSCG/8cgzkhkGC1gH6Z7HHx2/ZrYMTCmphFhX3OFtWbE
	 HKrHEsQhHzcQulJ1dFqawKu3PEZascFzT4lI1X/gzp8p0DrabYPzjixPepNk98odnUKpv
	 u8bHABQUG3QiPzTvmbRdgOfxJE+fyitHRvC+OoVwfCKWbLYS/i7zh7BlmxL1YgZAnQAKO
	 IvYpGuOSgIeQqIFOlfa0b8ryAExkNdWG8NriBtulRphVngGl49UnXCj/zbPz3OocTNA==
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="wC/Udj35";
	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 1883A606A32C;
	Mon, 16 Nov 2026 10:36:51 +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=wC/Udj35
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.54
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794825410;
	b=MQ+ppuCtZhjYa+CefplTsYXSWkNzZCZQaV3O+cBF/4cm+08wCG8ghebB8pyhnfyHigW8
	 LTwrAaYBD3EUBgQnjt7kf2Eys1Ocd18k2x1m5ezdRzp6lh4dMZYD9GtNhFKHNhayizW2t
	 I2FnOvbIVXFYTDQS42HOEsd71dBNFSNdebYNtoH44tJ2doLQKHGHGsDHZFO/y8Ov8H9qr
	 v7UpkKVUtNmowh8Bun1c3ZPJfBOrrCP1xUKWpv1HthWNK4Vp5Q3kzVsppUmHCOgdfJebl
	 5nX4TJu9aYLeTLFrd0F7+Xm8MHMltBZYi/80ZHwOLAxZQnnm083LNtLMPR5+VBchEGA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794825410;
	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=hrslb7xwY/P3caxQHjfg0Zlzk+SkRY2D0gWn0IfeX6Y=;
	b=IbO0p0hzw5okh5UYZ+1GdX7sBACvlINrJe/JmTXqxtNu/Ak8vjkBQ2QK34w+4sdtPVjB
	 dfsqdIIgCuxwpTF8F+uae93cbqHMxDXXtQ9NTDoQz4G5kI/lSDGDUNH0HgT7Xewuemxvu
	 mHE++hsxkTzv8xJqNAJpP7aeJ5Rranin+SLOF3rnZ0ahfVbph512y6PNUfc03pWlc8p/3
	 xcDdZYxeTM8edE7tleMixXrN3JyooSi/Rtkpja3PnsqziJ+8zzq6zp0uoblEc3UrUjcYB
	 xj5Rhjo6UlGtIFbUAVIwsmuENkwKJHDqGlmIbM9P4TDuOinxxAMdq7CJZfYM2O5lWTw==
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="wC/Udj35";
	arc=none smtp.remote-ip=209.85.219.54
X-Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54])
	(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 48A5E606A329
	for <netdev@vger.kernel.org>; Mon, 16 Nov 2026 10:36:48 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 48A5E606A329
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-f54.google.com with SMTP id 6a1803df08f44-91ec2d42231so47982626d6.2
        for <netdev@vger.kernel.org>; Mon, 16 Nov 2026 02:36:48 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=mojatatu.com; s=google; t=1794825408; x=1795430208; 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=hrslb7xwY/P3caxQHjfg0Zlzk+SkRY2D0gWn0IfeX6Y=;
        b=wC/Udj35b3zAdFfaRatiA+UL2HEs+pGiySYusb1ax5IeScQOsVwYXfLUlInj0Thd/t
         xhPbm/hOkTw5FqqRRkx2tLUIEHZwXpOpR/AbU9dRtbOmUB26AFoe2IZQ37TjnYwZVYOd
         qKQfc/BJtjiC1DzCK+849keYhKb1hCNNSJyn8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1794825408; x=1795430208;
        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=hrslb7xwY/P3caxQHjfg0Zlzk+SkRY2D0gWn0IfeX6Y=;
        b=xteYB9JklLMfUaLrdynv2Z2NsIkeXg2EjRDjNz+MrPKGNccCgekou67XMO0bGNfpUw
         4zW9oEdNEdDbZZScYLSzXbr2HKxinIWv9U/jpVvi3OQvaKRg6AjZAby7OeUrfFOa5pgK
         c5Pqa3PaHwa+rai5gKfkl7pU5mO9cak7jrPs5g6NlwkQ8ZDJExnOjLHNd1DlitNoeayC
         z7eApmLJKVXdJfjHyzTjGq2cr0GAK69ndU3ipW6UMpkzLVRJZLlBjETzXBs0qo4BEiPS
         fcJMKUOcuIrEx5igKaJz9vYIZK7eyQXmEPlJ1B0cjvPfBWKPAVHZO4t7fHJgyp1PrazZ
         hf6A==
X-Gm-Message-State: APuU4Z9twmXNrHnON6MXkZIXHmk4xl3+x7vsHTs1MbSwFim9KSIpizQn
	4yeAtpzzrIR5T9QgCqwABq28y2WPebBEABlhlIaTaaW/pN4ijq6Cmx5xdN9roQd99MG7BwIogc+
	6Ois=
X-Gm-Gg: AYBFou05z2b24cRLHv5sZ94EK4tBMDYbXq/5SoIflr7VH0b9NS+vWMez/iOM5kBZ+mT
	1/pvz7S2cCcgn7tosNWfxENL1anT+Azhx/eP2B2u+Dx4vP7BaoAuGA06X99FJm7nVUhUH2rYpVT
	nyb0BFlQLLuFErKjyidwTLIG+6K85/8AkWABBlbWXQ5zFqzUJ0BalK+OjqmcV6Oso1bvGyX8ktI
	CQL44PJFTcPAYZho/WSSs9JgzD775x7oF/SYzjqXtBAJpUxNpMFLTjNybHatvvk/mn3OxLRrWC1
	D26rFw4U5R0luXpDVzuW44/ZLyilINSM4/9r3lXB1TCX59/Lzu1T7jhTpCfBCbL0RBzQj8Ng+VL
	OPI4e63w4VVGxVpeb5qnmOeZrDBKhwmuADQvMUSjz6Y/MRZ/LPqvFu5+Vmu9hPQM+K0NDy4ASRG
	Z1uUbZqnuZ+ieO0SLR7Ex/0IbWrvT7Pvfzb72YTABRHn2h3A/jh+BO9HgU3JGwHnHld0nu9liqQ
	795cnFRhum1+fC2/DW59K7CJUdnBZBy7/ofex8tdzJ4zuWGuR4x8I0shWDuszmqA5sjLGtu3NsY
	oATkU8wPfKg5EDbU2/0V9E+74F4+jf6zaSdJj9DiC5hMLMctrZS+ZJAIhaqi7J1UtfdwqXstgFt
	7HyLCMQK86NWW7Vwe8Ez+
X-Received: by 2002:a05:622a:581a:b0:536:5a78:6b13 with SMTP id d75a77b69052e-55ac8880f3amr162945851cf.57.1794825408015;
        Mon, 16 Nov 2026 02:36:48 -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.45
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Mon, 16 Nov 2026 02:36:46 -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