Article View: linux.kernel.netdev
Article #13334Re: [PATCH net v3 1/2] net/sched: sch_teql: unshare the header before writing and fix retry strip
From: Simon Horman
Date: Mon, 09 Nov 2026 17:15
Date: Mon, 09 Nov 2026 17:15
57 lines
10523 bytes
10523 bytes
On Tue, Nov 03, 2026 at 07:39:15AM -0500, Jamal Hadi Salim wrote:
> The issue:
> teql_master_xmit() writes the slave's link header into the skb in
> teql_resolve() and on retry pulls it back with __skb_pull(). Two bugs:
>
> 1. When the skb's header is cloned (e.g. a tc-mirred action on a
> physical device's clsact egress redirects to the teql master), the
> write corrupts the other clone. Call skb_cow_head() first.
>
> 2. The pull always removes skb_network_offset() bytes. For an
> AF_PACKET/SOCK_RAW frame with no dst entry, teql_resolve() adds no
> header, so the retry strips the user-supplied one. Pull back only
> the length this slave added.
>
> The Fix:
> Track the added length per iteration; a header-cloned skb is unshared
> before the write and an AF_PACKET frame retries with its header intact.
>
> Conditions to recreate the bug:
> CONFIG_NET_SCH_TEQL=y and CONFIG_VETH=y, run as root. A teql master with
> two veth slaves, the first slave returning NETDEV_TX_BUSY without
> consuming the skb so that teql retries the frame on the second one:
>
> ip link add vethBAD type veth peer name vethBADp
> ip link add vethGOOD type veth peer name vethGOODp
> ip link set vethBAD up; ip link set vethBADp up
> ip link set vethGOOD up; ip link set vethGOODp up
> tc qdisc add dev vethBAD root teql0
> tc qdisc add dev vethGOOD root teql0
> ip link set teql0 up
>
> Send a SOCK_RAW frame that carries its own link header on teql0 and
> capture it on the second slave's peer. A veth transmit does not return
> NETDEV_TX_BUSY on its own; to hold the skb pending this reproduction used
> a test-only IFF_DEBUG accelerator in veth_xmit(), which is not part of
> this patch and was applied to both the unfixed and the fixed build.
>
> On the unfixed tree the captured frame arrives with its header stripped
> (176 of the 208 bytes sent, starting at the payload) because the retry
> pulls skb_network_offset() bytes while this slave added none. With the
> patch the frame arrives intact.
>
> The shared headroom case needs a cloned skb: a PF_PACKET tap on the
> master whose socket is never drained keeps the clone alive across the
> transmit. A kprobe on eth_header then reports cloned=1 on the unfixed
> tree and cloned=0 with the patch.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Reported-by: Sashiko (gemini) <sashiko-bot@kernel.org>
> Closes: https://sashiko.dev/#/patchset/20260824115928.4099988-1-victor@mojatatu.com
> Link: https://lore.kernel.org/netdev/20260824115928.4099988-1-victor@mojatatu.com/
> Cc: stable@vger.kernel.org
> Reviewed-by: Victor Nogueira <victor@mojatatu.com>
> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Technical Details
Message-ID:
<20261109171539.GU18859@horms.kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359472-linux-kernel-netdev=dewy.ruReferences:
<QDISC-6HS9.v3.r0.20261103062649@mojatatu.com> <QDISC-6HS9.v3.r0.20261103073017-1@mojatatu.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359472-linux-kernel-netdev=dewy.ru From: horms@kernel.org (Simon Horman) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v3 1/2] net/sched: sch_teql: unshare the header before writing and fix retry strip Date: Mon, 9 Nov 2026 17:15:39 +0000 Organization: Usenet Network Message-ID: <20261109171539.GU18859@horms.kernel.org> References: <QDISC-6HS9.v3.r0.20261103062649@mojatatu.com> <QDISC-6HS9.v3.r0.20261103073017-1@mojatatu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="409999"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:of0XPn3YFzVqnZ1bmXJnxG3ZMbg= sha256:Q3zgiYRJYCv2Sca4FN0VxUVmPWHJE8sOpfz3T+Dxk2M= sha1:ERCL2r8YnmOTj7mD8XloufXZHnQ= sha256:9TWTVUJ9JIbyM4UIwxTSdKPr5E2r1dCvZQubP86ul0g= Content-Disposition: inline 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 9F1E2113886; Mon, 9 Nov 2026 20:20:12 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[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] 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 V5QzD_X7b2Ge; Mon, 9 Nov 2026 20:20:07 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-359472-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 46DE11138AA; Mon, 9 Nov 2026 20:19:55 +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 6349B60BAEE; Mon, 9 Nov 2026 17:15:49 +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=1794244544; b=XXjm79I4kCOqPt4R8JVpqRnRTN9ch00YajTuXidW8J18Nz+Lr0SyhwzETVgfh9K5bmbU cBfCotuWuiT16WrwpZJ2ap8oILnACh0WU9yIPhndWi5YTASsr57sVpGZ6buAkjl/rybHO Cdjt13huZp/iBo324FVLfT+IdjyISNFJHHwAALNZKZPwQSfs9jW6aEZ1qzgIH36dRLRFz 5cUS+XYMKW6Yg7W9k8vxgj+MOQ54K5qLXe9xIomoaeyWIPsVXxs2eM0PVTUZVR/5o5Enk wYm2z2HTjf3SCu6omyrtb4avAg32YgEcv72lNr6X8IYfCA9YgzPjX7orrEywNIQR/mQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794244544; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=FV/gOIEqM460iJY+njk1sy17xCRYfoeAfz2fjXVt/zQ=; b=u+/hQWCpU9c0PnKpCgRqQFZVmIpFQrdIK4Bn1OYwBfP2oTfnYLMixrG+ch4xYyZ1LM8H OCivZcXZY+PNxa74UsW/T+JAQJRoTno1eO/rf8F7x9WaS76yOYZh/amLMx1xYF62Opf2C HDN2GcRezNQk96gaq/1euNrorxdbObJNOGm2J1XXlR3++zOnT0vUmCzg41T6ihvgGBZqd ZBoQFjqUPbwp1jtKcDhb9OToB+wY/u/3DSvT5xt0SIUCn+T7cgPtgpi5O9S15xfNNYpXd nljkdRh2nROlvbpjvGutQxeWJ0SKjqhLZxYcFx2Jwt4u2HNsIU/oPND6uazXaiiCJpQ== 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=QcnUzuS5; 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 CC282606A321; Mon, 9 Nov 2026 17:15:44 +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=QcnUzuS5 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=1794244544; b=g9B8c6VTlcLfFsx642Hm7ogq29fkIqu9GPNuYdL4x/nbsVFG6m/RUpwqgkaW5Iw9wHmE DLiwxid01qC3VaSvUIJcf8vlR/33p+O1UsyH5RtzxvUzfmZQNbQ6/rtTLuRXPQzXcpU+w MC4WY+8YXnZN1wbWK2StUnm9nH1jYun3/qZazghw2omIQBtWL9H8OX8LQV//hY2wOJiGl /V1AuUXKOUKFbkRPu9wKYt/2AcDCG5OW2mYFC+GCU6ti/BDx0l3ukxp7AVF/IcYuF1HcP 1/FKVQ0UdtfJC0ocz3zzBQyl8RU4Q35E0kXrboKfkQHGq/6ygPuQ9nGvRE9tIZ/AC5Q== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794244544; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=FV/gOIEqM460iJY+njk1sy17xCRYfoeAfz2fjXVt/zQ=; b=WhCLnlOzQEUFX52HGONsyzaFn2JyLte15c2jP99FvHvs58CbB+HbhNkQ0fXOR4RxeYdu 8ts2TdvBApgxNJJXDnzDqj5jAMeFTxh9a/Z0DNooM9LoXjaIgf0d9bp868JnFq/iolqXB jrzeD2Yi6mC9Gfd01usKEmPGcG0VWo8PISKL8FVLtbMX2GSgEGqyCPfv9jNes2OP+FdkT PsuLJRtdaF3bkg5F+t5XmmXyQe9zGObAgZoyE1EKwV16lrL7udIxkzjeY8ze9xf+2uCBa +BnE6ZY91wf1LKnb6CIklvvbg6SH9MS9xExQTp6HYuumyUQKevxoJaZS4D+dQ4Dp4pg== 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=QcnUzuS5; 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 A43A0606A325; Mon, 9 Nov 2026 17:15:43 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 716D51F008A3; Mon, 9 Nov 2026 17:15:41 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794244543; bh=FV/gOIEqM460iJY+njk1sy17xCRYfoeAfz2fjXVt/zQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=QcnUzuS5LTfs+FxCMi1X6w0Ur2hdM50fYhVpXhOh5BKqXzA+mAsBFp1XzUgsorXsV Ot2Et44aWuFTNwk7BK0NIHgALfpUaC8zndjBYR7K9gMLEH8R+OP9HcF6KYW7NTlsFr OshGPel1lfW0Arg+9GIls0X7KmHq7uAPx7QgyK+crZB2h6rF8UISk72qQfiQMOReOM 22Mpk9fibez8Q50iO0VSn7m0B23/zsVxWLMlOG1+1aQgYZ3/BctllzopDKEPv9F1jC PahI0erKUUBPfH55nJc6fGWkF/RAG59tbLkneH3T0FqCebOi9bWjW4hSsoU4vAnGlx FmyeLvhOlKPbg== X-Cc: netdev@vger.kernel.org, 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>, stable@vger.kernel.org, sashiko-bot@kernel.org 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-In-Reply-To: <QDISC-6HS9.v3.r0.20261103073017-1@mojatatu.com>