🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #6902

Re: [PATCH net v2 0/6] net: pull short linear Ethernet headers before eth_type_trans()

#6902
From: Jakub Kicinski
Date: Fri, 23 Oct 2026 19:28
56 lines
11038 bytes
On Fri, 23 Oct 2026 07:59:15 -0400 Jamal Hadi Salim wrote:
> This series fixes a class of producer/consumer bugs in which an outer
> header is popped and the packet is then handed to a consumer with fewer
> than ETH_HLEN bytes in the linear area.  eth_type_trans() pulls ETH_HLEN
> from that area and can BUG in __skb_pull() when the inner Ethernet header
> is not linear.  The affected producers are act_vlan POP_ETH, act_mpls POP,
> act_ife egress decode, and the Open vSwitch MPLS/TEB and NSH pops.  A
> consumer-side guard in act_mirred rejects redirecting a headerless packet
> to a device that expects a link-layer header.
> 
> Patch 1 makes act_vlan POP_ETH pull the inner Ethernet header after the
> pop and drop only when the packet is genuinely shorter than ETH_HLEN.
> Patch 2 does the same for act_mpls, gated on the pre-pop MAC length.
> Patch 3 adds the act_mirred guard at the redirect boundary.  Patch 4
> keeps act_ife egress decode from consuming the inner Ethernet header and
> restores the header metadata.
> 
> Patches 5 and 6 establish the same linear-header invariant for the OVS
> MPLS/TEB and NSH pops before restoring MAC_PROTO_ETHERNET.

NIPA CI flagged a regression that appears to be introduced by this patch
(or one of the closely related act_vlan/act_mirred patches in the same
series).

The selftest tools/testing/selftests/net/forwarding/tc_mpls_l2vpn.sh now
fails reliably (both the "ping" and "ping6" sub-tests, on both the
regular and debug forwarding test configs, consistently on retry as
well):

  # TEST: ping    [FAIL]
  # TEST: ping6   [FAIL]

The test builds an Ethernet-over-MPLS L2VPN using exactly the tc action
sequence this series touches:

  - ingress: mpls mac_push + vlan push_eth + mirred egress redirect
  - ingress: vlan pop_eth + mpls pop protocol teb + mirred egress redirect

dmesg on the test run shows mirred failing to redirect the traffic:

  tc mirred to Houston: device veth2 is down
  tc mirred to Houston: device veth3 is down

This is the same "vlan pop_eth followed by mpls pop" chain described in
this patch's own commit message as the bug reproduction scenario, so it
looks like the mac_len/pskb_may_pull bookkeeping added here may not be
correctly handling the ingress case used by this test, causing otherwise
valid packets built by this chain to be mishandled and the redirect to
fail.

Could you take a look at whether the new POP header-pull logic correctly
handles the "vlan pop_eth -> mpls pop protocol teb -> mirred redirect"
chain on ingress? It would also be worth double-checking this alongside
the companion act_vlan POP_ETH and act_mirred link-layer-header patches
from the same series, since they touch the same pipeline.
Technical Details
Message-ID: <20261023122819.5e48ea9e@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351192-linux-kernel-netdev=dewy.ru
References: <ACT-N6N4.v2.r0.20261022191829@mojatatu.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351192-linux-kernel-netdev=dewy.ru
From: kuba@kernel.org (Jakub Kicinski)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2 0/6] net: pull short linear Ethernet headers
 before eth_type_trans()
Date: Fri, 23 Oct 2026 12:28:19 -0700
Organization: Usenet Network
Message-ID: <20261023122819.5e48ea9e@kernel.org>
References: <ACT-N6N4.v2.r0.20261022191829@mojatatu.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="591280"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:33sfxjjc/6yabZWK9+3LptYmX2s= sha256:DES951/tqH6SG4T/x+T8ols8dD91zg5BFeR/RpfQZtQ=
	sha1:hp3+v9sP1uQbHQbJs3cCHVhOBpU= sha256:wFnTCcG+043TTWSuvQFMTtJ5qalcV5CiLAK2Hx2aR5A=
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 D49F111155F; Fri, 23 Oct 2026 22:29:08 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.739
X-Spam-Status: No, score=-3.739 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.339, 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 T2phMRFBAWJD;
	Fri, 23 Oct 2026 22:29:06 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-351192-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id A146B11155B; Fri, 23 Oct 2026 22:28:55 +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 28D1C39B90; Fri, 23 Oct 2026 19:28:26 +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=1792783706;
	b=ICyioYss6gLJPjafmblDFWWwCIIUeE3r51QClytqKK6jRbNEPHtux4WcgkTWt22Pziaw
	 k/SZFhhJJZdm9XrhAGV7CLslmrWPmV+ARKGdSuAm2oPxGfpoVLO2jqm3dOP2fVobqtSmf
	 cMPZhMX3iFHxX329faHXcALYTwOJS2LSBcsk8T2De3YSiaGC2nwAw2U4O81LFjxjt9lpZ
	 ev/6UzKEbVLsnjhrGo9tN0T7cuXvtqHG+EvZ9Mge/iI4NUg/ekwvnb7DUMUsDypf858z3
	 QQOTFxoxsfKKMoaDYseD+6XAQurzZrDAXGsLF6t5MV4KLTtkcK5gfo8W/N4SbCeNk4w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792783706;
	h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc:
	 Subject:Message-ID:In-Reply-To:References:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding;
	bh=QCUO9koXJEjic7Y8rskQ370+egV/LCuM74NkA6fYd3k=;
	b=2z9imJAQ0sSfFa+sjqHpgoIz4DqZ/RiGw/gzlSLve1sgjMUc7+es5xtgsRqKSpx64UjI
	 Biu/0oQQ0sE6GPRJmzsR7P5XrhbC4vhktcVjBbVN6NVjJ/CewCExHJ6B2KuIIxT3KKZRy
	 ZjobbOaaZVJQYp7DBudHOclUW9EQmIxmfnPVKkE7+H0tzVOMcHMzPI9ezOWGdzrgxuaSl
	 uxslKLAno/I/OFv8Xx5/b9l5LOYppcy/z98gmPVxeBvWngWxe2og5Wo70qQ/aHwUQs+Wx
	 jURfw657i8WW8DVpQSr+TKvrhbCkGbRxi0HK5agjtIdAR6grZD2/o98FU8Byp+PySwA==
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=faWtXKFx;
	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 F2305606A322;
	Fri, 23 Oct 2026 19:28:25 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=faWtXKFx
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=1792783701;
	b=zQt7M20kZxbV1obBzIZ7s/aUkGJ/kUWONFuk+UhuxOP8u2AYm0sKSeGAaiEaRoxB40OV
	 KcNGkCp5rwqmKa8bCxn4q0ECbQQcli8Ptu3zUPzYiF2I7g5WIpuaIlFN8AhC4GgyLM3AH
	 vHEfFIHc6SovTb4gkg4Fetauz8uG60hrWStWrcsp5lLCPb9FgUVIyunnqn5nmKQjLXwsp
	 YXGPOxEZ6wsx44EygwvB43DPpJpYzBEekFmymW7ZNLnLGPMRAfAyvFHI5y8PlusHzRdTk
	 Lm871CE75NUYJjKkZGK9TnNoyTq37CBOK1It0ABPtO4zx5/P+4AT9iws1ENFW2oV4gQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792783701;
	h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID:
	 In-Reply-To:References:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=QCUO9koXJEjic7Y8rskQ370+egV/LCuM74NkA6fYd3k=;
	b=t8FJkCgPzWe2JZ7mTdqcls6T+yYXwdzrUxbj/aIBQKvPox1fCC9+MlHY39OIE7aIbozw
	 NwOBlKT8kSxR+2tbF97jJl2XI6ZzDDPQ7pohpiYPdICyLG5xBBqfXQUAmhkckGmGiSZ8e
	 r3OjJITEQQjbswWTcWUcbQqaP2HsT8nttuIsc7ntsDM194jvp06y/e5XDbtuTssB/bDCL
	 ajrw/aaIXsqKFRpZRmn7SwzziKfZyNnpfIejLL9BnO1bVocAR6G0UBORrtPagWQuAqo/J
	 Wn655Md128T9hzrTJkyNAwR+VgVcMM+k0X3BtCYhdUPkJQK7G80fxOm8HFGLVdafLMA==
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=faWtXKFx;
	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 DAEE0606A31D;
	Fri, 23 Oct 2026 19:28:20 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7B7C1F01825;
	Fri, 23 Oct 2026 19:28:19 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792783700;
	bh=QCUO9koXJEjic7Y8rskQ370+egV/LCuM74NkA6fYd3k=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References;
	b=faWtXKFxdICbmTEKMgXhgkn0mMBdvAXVi17vlJ6SI5zw9k/c0KtFGlNq2meSuOPCn
	 /986U79B5nDQOfQnAcj8LOxQwIDt7+XdLd9oMMbeC8xO0Vp+stvq6krq1ZRO9yuOcT
	 QYORjbFizBDhNg8uF/nngNfsrcbWQX8ZCLmMQz9ZXb5V1rESJAkVObiJWxmIcGvuAA
	 /BfXfJMr839pD9QmhH2VJDK3QIHhNFNg7GxJNHiEIPjw1I4SjQhAuI2Thzh+mkB6gW
	 +FLsHiR2zyl560gKjLKduLt20kOxwdXMVCPZXBSRfNQ0wsIIgDhHnidyZmIKRVWSmW
	 wPmFOFAbk4E1Q==
X-Cc: netdev@vger.kernel.org, Jiri Pirko <jiri@resnulli.us>, Andrew Lunn
 <andrew+netdev@lunn.ch>, "David S . Miller" <davem@davemloft.net>, Eric
 Dumazet <edumazet@kernel.org>, Guillaume Nault <gnault@redhat.com>, Simon
 Horman <horms@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Victor Nogueira
 <victor@mojatatu.com>, Vega <vega@nebusec.ai>, Ren Wei <n05ec@lzu.edu.cn>,
 Herbert Xu <herbert@gondor.apana.org.au>, Jason Wang
 <jasowangio@gmail.com>, Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
 stable@vger.kernel.org, Martin Varghese <martin.varghese@nokia.com>, Pravin
 B Shelar <pshelar@ovn.org>, Shmulik Ladkani <sladkani@proofpoint.com>,
 Yotam Gigi <yotam.gi@gmail.com>, Aaron Conole <aconole@redhat.com>, Eelco
 Chaudron <echaudro@redhat.com>, Ilya Maximets <i.maximets@ovn.org>,
 dev@openvswitch.org, Jiri Benc <jbenc@redhat.com>
X-In-Reply-To: <ACT-N6N4.v2.r0.20261022191829@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