🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #7064

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

#7064
From: Jamal Hadi Salim
Date: Sat, 24 Oct 2026 14:28
71 lines
13514 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: Aaron Conole <aconole@redhat.com>
Reviewed-by: Ilya Maximets <i.maximets@ovn.org>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>

---
v2 -> v3:
  - no code change; add Aaron Conole's Reviewed-by.
---
 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.v3.r0.20261023200137-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-351387-linux-kernel-netdev=dewy.ru
References: <ACT-N6N4.v3.r0.20261023200137@mojatatu.com> <ACT-N6N4.v3.r0.20261023200137-1@mojatatu.com> <ACT-N6N4.v3.r0.20261023200137-2@mojatatu.com> <ACT-N6N4.v3.r0.20261023200137-3@mojatatu.com> <ACT-N6N4.v3.r0.20261023200137-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-351387-linux-kernel-netdev=dewy.ru
From: jhs@mojatatu.com (Jamal Hadi Salim)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v3 5/6] net: openvswitch: ensure a linear inner Ethernet header on TEB pop
Date: Sat, 24 Oct 2026 10:28:40 -0400
Organization: Usenet Network
Message-ID: <ACT-N6N4.v3.r0.20261023200137-5@mojatatu.com>
References: <ACT-N6N4.v3.r0.20261023200137@mojatatu.com> <ACT-N6N4.v3.r0.20261023200137-1@mojatatu.com> <ACT-N6N4.v3.r0.20261023200137-2@mojatatu.com> <ACT-N6N4.v3.r0.20261023200137-3@mojatatu.com> <ACT-N6N4.v3.r0.20261023200137-4@mojatatu.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="777186"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:0eeSYJjXxOxBm8EU0NE0YRxnCZM= sha256:Q+gF93bKcgvDfaVNx5UxV6h4FfFTuaAD+yMkEIeWfX0=
	sha1:DXq9InWuwNoSbyUViAtEG7TCMp8= sha256:qD5idIVONNYUPeULnXIk+ZQPn5YYa/0wOu7ypIfx1GI=
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 C48D511164E; Sat, 24 Oct 2026 17:34:10 +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 Zof0VkTQg0H3;
	Sat, 24 Oct 2026 17:34: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-351387-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 82E7F111162; Sat, 24 Oct 2026 17:33:58 +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 95AD134C1E; Sat, 24 Oct 2026 14:29:04 +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=1792852143;
	b=DA3ZJapdeDFCFZJ4D7H61jVoy8bRP/oNwP+A+bkVoHAJCPbMIU+Vnov2mdePVVJyoU/y
	 8ka4TE/KU4K9x05tR0FrEOd9o0GdsCOFcZAflKhsRtzY31fQp8mYm6WNaOuijYNeWSNuU
	 GPuzY5gqbFpfyJSff+k/pyF4FDl+P9sg2HU3Qa2WUdHkP1rYGPaqjSanrkBTh61sMQpyB
	 E2+QNu74xU/+TlXFO6NfY1zU5j0EVyzYas5D3ricAWM7MttcWtGSdoCLUg/fwn8K5wj1z
	 JBkVUUnu5xAQiQqv5Z1a48sDK91iNo/KzwxtFsJSe7xaFHdOFYE90gaXmcdJvTTdBGg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792852143;
	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=xuYAqvftjzynacCTLNgIg0wwHTh7boJUBn23V0yCGAQ=;
	b=zdhU4HDIw5/XfU2UdilxkeQ/L3Uf2RvAGaW2htX+TBMGboLwcAVyUmQWLuBFT78EjIbB
	 8lnMtGN0m9QxVusJiQ4gM/P3o8Xf1kIhqKw9jDE1M5cjrzv2bdC6r1VmcLONHW0B1rW9Y
	 YZE6qlmH1qnUEOvKoGXOVxmgDzwwUZqD5rRUEhPn+txBy0HMCyK5dFF2Eh7iT0ohMbTBX
	 E4RNTnqivIESpJkP2GbW2eqAivhyRuBA2NrLxfmmjyxQUFz4Hvw3r7ceqZHTvMjNG+xpK
	 bI0jcM8wXKQWVA7QHuRCf0kzn55oFQ1D2nrbZH1jGQ3iX4DY2ZSYI9QZwL5nhm/2Ncw==
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=DGdsW4Br;
	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 9849D606A32E;
	Sat, 24 Oct 2026 14:29:03 +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=DGdsW4Br
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.171
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792852137;
	b=qTCLH/u9kQxlZwwep4xWoJGNKLH/wnp30nnZeXE2GpNoEi2UDCZxxRBL/D6CmiSunqYb
	 AZ6+6QQvKlIUwm6yw1N1wFgqLdiSa1xCKAMOG2Ujqu/n4m+ITyTb+WIR8uCsBOllfP4KB
	 +//lgaUZ4KtOLHIROz6raBmttov6+lGfqp3/f12O3B2mWWm5muJkrB8h9fBQubhhU1738
	 HAB5QAJg61LMids2uIXEApw60oZJ+gJFHNjSFZEWZiC98wwmJGcX5Dn9s9d4KAD/PBWbK
	 Du8lao4IrRuQxC6e1g71SMoa9EYda+yVyijLE7jsVaTjeTUq1G4/bCsY1z8xt+4Qn2w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792852137;
	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=xuYAqvftjzynacCTLNgIg0wwHTh7boJUBn23V0yCGAQ=;
	b=vBcUZacC9iSWgUcBcR1JVdPszWd+IyjKLSbF0Xj1T6Eev4NSe4K2r4WIVpaKUGCRyp+k
	 WYK6dotQl+VS4w/w+s/141gHLjD5gpD7Ki8oO27ZheXXcXQ/pBUTpFutqUDEsR6LxHqSS
	 a+hOGPfau5Hz7rMM3tX23RyIo6xVUuitPJQopZiOhmWHfQ6o9CtQDtqUB0At6LrCmuNbI
	 4FbS/6rZGRgCSJ4SXiCByEOEkBtGsywPtiMt/KalA8iNBd6ldIcDtytsGCWRV1sLis0hU
	 NrYrsyOzOOpmeoZS+2jKoK/V+DRyLvhHj5ks3CXdm4iBK4GetTTE6L7gJhJegqeuJWA==
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=DGdsW4Br;
	arc=none smtp.remote-ip=209.85.160.171
X-Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171])
	(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 6B22960A2607
	for <netdev@vger.kernel.org>; Sat, 24 Oct 2026 14:28:57 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6B22960A2607
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-qt1-f171.google.com with SMTP id d75a77b69052e-53653e30353so6242771cf.2
        for <netdev@vger.kernel.org>; Sat, 24 Oct 2026 07:28:57 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=mojatatu.com; s=google; t=1792852136; x=1793456936; 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=xuYAqvftjzynacCTLNgIg0wwHTh7boJUBn23V0yCGAQ=;
        b=DGdsW4BrAohZiwSdkHIU4e/O/eFXLanlU31R4EZJe1h0+AhDNhmFObd7uFnFfj0+Cc
         N4jDUVpkemtiSJAsgbz7hUxSCg7uUHbb8NYbpXsWaDT6Es9tooivzcNjN4nNE9CnGBUX
         DPSijLLWJFX8ttsqJV/7oKsOTqfxcq8+ruMAs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792852136; x=1793456936;
        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=xuYAqvftjzynacCTLNgIg0wwHTh7boJUBn23V0yCGAQ=;
        b=miT48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nhBUw7aGlpehZy7VZM8Fdc//n2UyVe0bssci0fn4PgndH3gduWWi7gk
	10KzGwsl5p1/+LTG7hcSeSz1/jGMSmx+W13fRcF4BQ==
X-Received: by 2002:a05:622a:90b:b0:531:164:fa73 with SMTP id d75a77b69052e-5383b554080mr28941861cf.32.1792852136437;
        Sat, 24 Oct 2026 07:28:56 -0700 (PDT)
X-Received: from mbili.tail33bf8.ts.net ([64.203.83.2])
        by smtp.gmail.com with ESMTPSA id 6a1803df08f44-91c47a7cd7esm22349976d6.2.2026.10.24.07.28.54
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Sat, 24 Oct 2026 07:28:56 -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.v3.r0.20261023200137-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