🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #6370

[PATCH net 4/5] net: openvswitch: ensure a linear inner Ethernet header on TEB pop

#6370
From: Jamal Hadi Salim
Date: Thu, 22 Oct 2026 09:22
64 lines
13198 bytes
The issue:
pop_mpls() restores MAC_PROTO_ETHERNET when the popped ethertype is
ETH_P_TEB, but skb_mpls_pop() only guarantees that the MPLS shim is in
the linear area.  When the inner Ethernet header sits in a page
fragment, the datapath now claims an Ethernet header it cannot access
linearly.

Output to an OVS internal vport then calls eth_type_trans(), which
pulls ETH_HLEN from an empty linear area and triggers the BUG in
__skb_pull():

  kernel BUG at ./include/linux/skbuff.h:2830!
  RIP: 0010:eth_type_trans+0x335/0x500
  internal_dev_recv
  ovs_vport_send
  do_output
  do_execute_actions
  ovs_execute_actions
  ovs_dp_process_packet
  ovs_vport_receive
  internal_dev_xmit

Conditions to recreate the bug:
On a system with 4 KiB pages and CONFIG_OPENVSWITCH and CONFIG_PACKET
enabled, use CAP_NET_ADMIN to create an OVS datapath and bring its local
internal port up with MTU 9000.  Install a flow matching an Ethernet/MPLS
packet with one bottom-of-stack label and actions pop_eth,
pop_mpls(0x6558), output to the local port.  With CAP_NET_RAW, send a
4128-byte AF_PACKET/SOCK_RAW frame containing outer Ethernet, the MPLS
label, inner Ethernet and 4096 payload bytes.  The two pops consume the
linear headers and expose the inner Ethernet header in page fragments.

The Fix:
Pull the inner Ethernet header into the linear area before restoring
MAC_PROTO_ETHERNET.

Fixes: f66b53fdbb22 ("openvswitch: New MPLS actions for layer 2 tunnelling")
Link: https://lore.kernel.org/netdev/e85fa16e-df3c-43dd-bb3a-9edca07200ea@kernel.org/
Cc: stable@vger.kernel.org
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
 net/openvswitch/actions.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index 27152bca8a8c..03b31e33e880 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -153,8 +153,11 @@ static int pop_mpls(struct sk_buff *skb, struct sw_flow_key *key,
 	if (err)
 		return err;
 
-	if (ethertype == htons(ETH_P_TEB))
+	if (ethertype == htons(ETH_P_TEB)) {
+		if (!pskb_may_pull(skb, ETH_HLEN))
+			return -ENOMEM;
 		key->mac_proto = MAC_PROTO_ETHERNET;
+	}
 
 	invalidate_flow_key(key);
 	return 0;
-- 
2.43.0
Technical Details
Message-ID: <ACT-N6N4.v1.r0.20261022051412-4@mojatatu.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350474-linux-kernel-netdev=dewy.ru
References: <ACT-N6N4.v1.r0.20261022051412@mojatatu.com> <ACT-N6N4.v1.r0.20261022051412-1@mojatatu.com> <ACT-N6N4.v1.r0.20261022051412-2@mojatatu.com> <ACT-N6N4.v1.r0.20261022051412-3@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-350474-linux-kernel-netdev=dewy.ru
From: jhs@mojatatu.com (Jamal Hadi Salim)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net 4/5] net: openvswitch: ensure a linear inner Ethernet header on TEB pop
Date: Thu, 22 Oct 2026 05:22:21 -0400
Organization: Usenet Network
Message-ID: <ACT-N6N4.v1.r0.20261022051412-4@mojatatu.com>
References: <ACT-N6N4.v1.r0.20261022051412@mojatatu.com> <ACT-N6N4.v1.r0.20261022051412-1@mojatatu.com> <ACT-N6N4.v1.r0.20261022051412-2@mojatatu.com> <ACT-N6N4.v1.r0.20261022051412-3@mojatatu.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="176774"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:+p8iiCglJbVxBQh7UxfBWbjIi1A= sha256:OU4GNVx94bZcX/V9716ghsB4oBi+CarWGG0q/Om8Pag=
	sha1:q2+owiftxWYA0UE7FM3SGCSgJL8= sha256:yH8Dr5foOaL6c28kClADx6UC5p/6Ew5OSLBTp3YezaQ=
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 595E4111210; Thu, 22 Oct 2026 12:35:23 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 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.25,
	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 4SOzVzaRxVWr;
	Thu, 22 Oct 2026 12:35:21 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-350474-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 B814911120F; Thu, 22 Oct 2026 12:35:11 +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 C5EC726608; Thu, 22 Oct 2026 09:22:46 +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=1792660956;
	b=SxpbuTmYd8fYDkgVN9YuUWbnx0ZNCuu1OwT5jbeH1CH0FIu5OzHNuvmDBj2ff1ebdHc2
	 NvlgQq9d2OMB4vPT93Ai4P6VKTzfhzJxYb5XoJh2mQbsVxk792+eo4GVwnz8cmYoPKnnA
	 sxw/x2cEgEqTclARxQJTTnjU+QjvsdenjwtRBi696680XBFNW21xv1/wwLvl5pChnR3rq
	 UxTOFI632Y39dioE2t+gKkF+BiaG+TG9zuiLpzBSCXXPsmK+KXcluXwusW+rL4m89sXwV
	 9MF6o4/uT04DnmEGK1klhV2mZUSelYpzRCRdhfDohpAJ3/D5DlGAe77SphKSRZ7yOhA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792660956;
	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=FU1XSWmj++ibIHIRMssfhNs6Kxu554Fq4tiwLZtw/UU=;
	b=k0Ufwasjh9luBcLBonh7bLdNMa+KjuO5i7JoLscMECioDdtcGXsYkcwqDw2khOoZiK3u
	 0fHuNeCx6PrMWQe8l1hinYzwZJL72pRnkySMUU8AZb6F9lzGyjE5S1q3uOU1kt80DO5Gy
	 flBr+/tgsDF3+ruJW+EMZCZDSpB2dc6amqiDPosfU+J01L882oIH6OIF1nkmmCiAMPxne
	 26gcV0qa5sebfaBveXmry83RrLia57CuaCNf370ardUnM/G8E6CGTWOPUTIWBD9kyJXTO
	 8Sc+6+DeMqBhc55EMmKHUGGhXFceqK/GcxfaxkgRms8pgkv4AmHbJ2EMKltj/xPNYRA==
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="HO/kFuk7";
	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 9F739606A32E;
	Thu, 22 Oct 2026 09:22:36 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=mojatatu.com header.i=@mojatatu.com header.a=rsa-sha256 header.s=google header.b=HO/kFuk7
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.222.169
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792660955;
	b=dvlyXfdpSlur2Ic80pQ0VSl1FlUD6wTOYrXY8a9DX6Q+W0glf1vW4byn0iMSmjah1u96
	 qjjA98lkkIjUG2ccsJ0BjGa7MYtWN1gKxZTFgVaPb0WNyTGLQRUWh0rjFMajM2pVNutuw
	 UDXlNXzjQIoaSv7MboePYnl2Sx/fTWFM7MwNikxJvnO8uVLyJsp4xLF9IP3VJxB6FalNo
	 4hZje/pMKWEQfydCD92fr1gEMwMU6A4M7dsy3I2cuSeBwiLlahpRU78r008errPIRz2rD
	 1k9Zuy/SMT2Iu5SeAMPMaDV7Q4ggI+tRT2sQMqgTaRR+kd2Jo6Gk1UrEuptFAr4TWpA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792660955;
	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=FU1XSWmj++ibIHIRMssfhNs6Kxu554Fq4tiwLZtw/UU=;
	b=ThYJJ52gGv0UVHEH/fV/H9IpLiAVRERqsp/C3BLccyBwarrQkpFK+6pHzywmxQovL/Mx
	 Pgf1ex7nNzWg+e1Hz3NYxw6Gdp0UC2EahmTkeBtW5wUNQhJrC7zBr/TJFirk93U6Pm8po
	 0CJdHLfMgNpUqiJMQkU9AJZwDPks2jNX5xFs/RVyf1yPHRg19HVKG21HZBo1LU9JOSicG
	 B/hGyWYSFTIpqn5toHfzW2Fj6wob/151UpnKd55NDX6JZMnC6+1PzN3/nc6dK4htJiXz0
	 JygHZQ1Pvs59fdix2tyBEPpC2FgKeDmvVQm03v5HwRDuXyu1fb0tCcRG8A6MoSONcrw==
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="HO/kFuk7";
	arc=none smtp.remote-ip=209.85.222.169
X-Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169])
	(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 753F760A2601
	for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 09:22:35 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 753F760A2601
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-qk1-f169.google.com with SMTP id af79cd13be357-93a40a9a01aso88116485a.0
        for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 02:22:35 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=mojatatu.com; s=google; t=1792660954; x=1793265754; 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=FU1XSWmj++ibIHIRMssfhNs6Kxu554Fq4tiwLZtw/UU=;
        b=HO/kFuk7FCO5dJFBDbR1SvBkEcbzi2qKZEppDLmcN9ag9nG2ZJduZ5IIrdsvHyADIn
         f6Uo6NRyOuNpiYjBJUEU80y2k2QwlNeezB2RuRIWT6F6p0wCPjwvR79vfnoTGEf3hcWJ
         VRjjCrpVxZQqC1LRJRd4KcCzM7RompyKCUXWo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792660954; x=1793265754;
        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=FU1XSWmj++ibIHIRMssfhNs6Kxu554Fq4tiwLZtw/UU=;
        b=UH6V+W+nLoEdimCmUz472IatCFdTVaiDVMFxv/1mTiPqNh4JCADxa3kgVhjMFTzArr
         p70hsao16wal7fhdip/p0X/mKPWXJRmnAfWgcnZ7lW2NH4Wa3r2++igtywpDu0mIhypD
         HjMwDK2yApuomsqUaYWsFs0PMUV6Auwj5re8w60tJsw4S96ZJxh2AAhC4dmKU80VqQLX
         +8gyYrtRr0ntCrnpdKtdCR4cA97KMkiZ5hn10hr5OqHuBx/MRFvCDw2b1x43xsI9Uw9/
         4TPyKx3D2LUWIgYnHvoqSNSc8ZTgbAkpIiWFYYWX9gFQDwrv+RHBIclnM/EjIwcL+8cX
         bbUg==
X-Gm-Message-State: AFq9FYKZ/w18DlqkOzywbAs+j/GvHNAZJRgC6EjtI0md/15Fe/NGBuYv
	XhwEucZnahIdBBMPIoN6g3NbQlLHUqHeLtkHf4+LiJcR798Vv3FivBxL3ov8FFbUGBCBmhViNJT
	WjsM=
X-Gm-Gg: AYBFou3e9MxGr6ikWgEUGKgB6cIbGJbjAffamtrxdZ+QkUy8GKkinaTAv4/tq8EcVPz
	7N5aheponxIgdotKmhZsKJix4NGOGKjY9up024vXZsbPfUucGhL5/1dTscOLPWJCvEt+pCf2688
	I3PPMgdSL9kzKZKxsgnSO9WG/gnEEgsoRuKorTPYhObcJdnkqGuUynP3+yj54CK5tky4ZU4JoG/
	hmamQzbnV5NyN6RETpH9/vRmtJkNMnDIljYVx1Fuxo1bMEYKCdSH38Eml/x7LsvQIg4ifeE1yWF
	MuZ+eyTgY5P7zSsF9WSj64UNSYt7BEoM8w850COdwJeXk3bXAcLMEymVPiYTtpiNupXjfCaDEHw
	rzr2dEosGfnhX2bsveT5iq8e/8NyIe2ESqe2A1hV/9CPNnSKJVZIbdFGA3x+62mtQm2QpoAwsXg
	pdzjt6VFSz8uyvhkdc7OvXN+d1pnYANNX5rhLeKrN/pWuFywrhGatRWEzyxyAx1ISTfCtihUvjp
	lVN9IOUb8KvBGFTNQ9MJZW2JtxFDpwNhSnArmaTJkMswdac1w5eIeuesZK/1mCw4v98UeYR7Rqz
	1msvB7AVbn/sEijSsYvrQlusRg==
X-Received: by 2002:a05:620a:4686:b0:93e:5534:e63 with SMTP id af79cd13be357-93f624de650mr270152185a.13.1792660954420;
        Thu, 22 Oct 2026 02:22:34 -0700 (PDT)
X-Received: from mbili.waya ([64.203.83.2])
        by smtp.gmail.com with ESMTPSA id af79cd13be357-93f56e2a60fsm469884685a.41.2026.10.22.02.22.32
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 22 Oct 2026 02:22:33 -0700 (PDT)
X-Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
	Aaron Conole <aconole@redhat.com>,
	Eelco Chaudron <echaudro@redhat.com>,
	Ilya Maximets <i.maximets@ovn.org>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Pravin B Shelar <pshelar@ovn.org>,
	Martin Varghese <martin.varghese@nokia.com>,
	Jiri Pirko <jiri@resnulli.us>,
	Victor Nogueira <victor@mojatatu.com>,
	dev@openvswitch.org,
	stable@vger.kernel.org
X-Mailer: git-send-email 2.34.1
X-In-Reply-To: <ACT-N6N4.v1.r0.20261022051412-3@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