🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #6801

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

#6801
From: Jamal Hadi Salim
Date: Fri, 23 Oct 2026 11:59
66 lines
13394 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
Reviewed-by: Ilya Maximets <i.maximets@ovn.org>
Reviewed-by: Eric Dumazet <edumazet@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.v2.r0.20261022191829-5@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-351055-linux-kernel-netdev=dewy.ru
References: <ACT-N6N4.v2.r0.20261022191829@mojatatu.com> <ACT-N6N4.v2.r0.20261022191829-1@mojatatu.com> <ACT-N6N4.v2.r0.20261022191829-2@mojatatu.com> <ACT-N6N4.v2.r0.20261022191829-3@mojatatu.com> <ACT-N6N4.v2.r0.20261022191829-4@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-351055-linux-kernel-netdev=dewy.ru
From: jhs@mojatatu.com (Jamal Hadi Salim)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2 5/6] net: openvswitch: ensure a linear inner Ethernet header on TEB pop
Date: Fri, 23 Oct 2026 07:59:20 -0400
Organization: Usenet Network
Message-ID: <ACT-N6N4.v2.r0.20261022191829-5@mojatatu.com>
References: <ACT-N6N4.v2.r0.20261022191829@mojatatu.com> <ACT-N6N4.v2.r0.20261022191829-1@mojatatu.com> <ACT-N6N4.v2.r0.20261022191829-2@mojatatu.com> <ACT-N6N4.v2.r0.20261022191829-3@mojatatu.com> <ACT-N6N4.v2.r0.20261022191829-4@mojatatu.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="490393"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:2O3ugvTp9c7ydDHcnDn5NU5b5II= sha256:PKbYbbqjWz44Ktp7HY4sxxTOcBARNrrg3XxYtrkrjWg=
	sha1:qkdXTR2X/xtlSihfQY1vPQo6slw= sha256:GOXbTfsbA9klgUqtKokGup4NssTN4yHLje22UwsjUr4=
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 2ECB811147F; Fri, 23 Oct 2026 15:01:16 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 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, URIBL_BLOCKED=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 6wCG6n2I32Q0;
	Fri, 23 Oct 2026 15:01:12 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-351055-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 1D5C611145C; Fri, 23 Oct 2026 15:01:04 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 0C08134BE7; Fri, 23 Oct 2026 11:59:40 +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=1792756779;
	b=WT9QZztOh085wCVYhvS2YtEr+eH4AZ2QcgskyIlUKZAMzUBC5+PkTNihuzVQ717v98lD
	 tOCHYldKPCih1W/8ju+lr2qTWCGlljE6sPsL8xa9MWS0Xfw3EUTuarHR7GFeAj7vJlnLR
	 1B82nhir0mkNnzA6GAGE/QbkihNdrq5sXBe4kgvwZPWNKR0fZfDnlQM+P4WIktIxgd7tG
	 2NWp8Dfwvm+UYBZ25OcICWA6MLjw+9wGnW+pYhJOp/KjNmK5oqaG6uzDiR51l3I9iMYCX
	 Tl6uAeFMbua7Kv0cQg7jZu+YyK+6/aGXIa4Z1+kUvP+XYtGEo4W3X0BgJ5+3TYM+vgw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792756779;
	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=ODXqAHSl1PzO+WlHi3VkH0G2LZlWHwMXjD7qVV4H+Tc=;
	b=iINodOwf7SCpvu7oX9MYd/CQBeWVZc0mjbTb9ql+Vl/UbaiUTDyRjzql0ZBJWG7ylPGt
	 fu6ukzXh3UVj3QT3FDQysB+REXZwx6xh5B5/Ot9X+7P6bCt/Isrhs/pjK7lLNi+J3Oc0d
	 PZUM09bLIpFQWdSsHwbETZMY65MWUc3YvhwcZO/hgKMwhDUIlsoWNyyVOAW7c8g+ou0cQ
	 12AyXb49LBxSGzQ0qUD07Pa92e4aelhEmzhDLc+W9o8WrBrabtU1eeORdYVZw1fF5oQcU
	 1w/X6NTlKOzbhTjPmpVwnXlzFFcMpZv0y0nolqLejIt4VovK00EXk6AxaMndlUVBKJw==
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=cjXdylKS;
	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 E5F97606A321;
	Fri, 23 Oct 2026 11:59:38 +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=cjXdylKS
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.48
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792756778;
	b=Ng8zMrMzAIa0N14GASv+PPUluzPAsYy9twEz/H/rqlKeIgJgw7THKoyKf9YRHAwu+0lV
	 +pgtG/VU0v/jPHZhREjn1oFg/TbaUeWsHMUHW6FsqIdrQ7gt2eTmBQXyeZnW0T3l/fnJx
	 5Xx19d13YlWSMP3Uy5RMDMet+6wTziI2+pxj66VqSt94hztZyrrMDtmmRVDTc3WnHU1Vb
	 dGbQF1gyi7xKpVeMGsMBZY5j10/hoXoeMjpKrcysCyz1eTa0OvkEWwHae+q3VIPB6j9xO
	 EdMb44NQiCYhFRmfgiuWJVNZwAkDPHMvc3RvUKZOHuo2sLBupPn+ayQgFSW1Iu9gg5g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792756778;
	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=ODXqAHSl1PzO+WlHi3VkH0G2LZlWHwMXjD7qVV4H+Tc=;
	b=e6xuxZfdV51nmfc5pfSMuXUzhVFWdHSjp/8MqKPv5bArn/EUcEz8xBy5Rhfm7Z9bVsVk
	 3+G06R9NmNnaMvzXEwZGKUj5Q6xWhq+JcCQ+ehipd6t4d1u98aR605xGmGhs+tt/HM5hr
	 qq7/BF3iyZXJUO0A6ufaxr0IYwij8ts1KUfdDnOoDlzzXjdPmH5gSKGDvCbt4rRlizmzN
	 Uh/upck6ILwMYo7ZjeHSEEOStPpz5FU3D8azYJuwIyCp0zhEgA9iGOSrpOkLAJLpi4EOv
	 I2WTP8zmfPbpkxWObz664YeHdCHUiKe7K03jkJNIOimjhirFzYZq+siOkoSUWw1P8Cw==
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=cjXdylKS;
	arc=none smtp.remote-ip=209.85.219.48
X-Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48])
	(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 B4C47606A31F
	for <netdev@vger.kernel.org>; Fri, 23 Oct 2026 11:59:37 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B4C47606A31F
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-f48.google.com with SMTP id 6a1803df08f44-918f75a68f0so12144026d6.1
        for <netdev@vger.kernel.org>; Fri, 23 Oct 2026 04:59:37 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=mojatatu.com; s=google; t=1792756777; x=1793361577; 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=ODXqAHSl1PzO+WlHi3VkH0G2LZlWHwMXjD7qVV4H+Tc=;
        b=cjXdylKSOAu5bD0QGJAPwgXR8f/IvlXcgMSjZ7tyObvJC/6q8pxPUAsdcCYrMy4a+F
         psPWB1mAg2iznCNJNp3GwM8IEw4XumEmizNYh9DBpYGSIrSJYqTjUceN7ZDY+mYn/6zO
         hXQGMoUJ0nih7gjkktxUEn6E+LtvOqrd9qpqQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792756777; x=1793361577;
        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=ODXqAHSl1PzO+WlHi3VkH0G2LZlWHwMXjD7qVV4H+Tc=;
        b=vRdyK0ia0a4Nf/TUPi7PUr24QcXKz8Cr77OLGUoHNduFojzUbygGBt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VeE2um8Jifq7Mgg7K9KPzzI/O/PSoxHi2UAIAOX7Nw==
X-Received: by 2002:a05:6214:328e:b0:90c:4422:84d1 with SMTP id 6a1803df08f44-91c3ab17827mr24192296d6.30.1792756776725;
        Fri, 23 Oct 2026 04:59:36 -0700 (PDT)
X-Received: from mbili.tail33bf8.ts.net ([64.203.83.2])
        by smtp.gmail.com with ESMTPSA id 6a1803df08f44-91c396af493sm18358246d6.9.2026.10.23.04.59.33
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Fri, 23 Oct 2026 04:59:36 -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.v2.r0.20261022191829-4@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