🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #2428

[PATCH 5.10/5.15/6.1/6.6] vlan: require the MAC header to be present in __vlan_insert_inner_tag()

#2428
From: Alexander Martyniuk
Date: Mon, 12 Oct 2026 16:33
59 lines
10270 bytes
From: Xiang Mei <xmei5@asu.edu>

commit ab888242fce4f16f6c4d4c6ec53939ad36aa3b3a upstream.

__vlan_insert_inner_tag() only guarantees head room via skb_cow_head(),
never that mac_len bytes of MAC header are present.  Its ETH_HLEN
wrappers - __vlan_insert_tag() under skb_vlan_push(), and
vlan_insert_tag() under validate_xmit_vlan() on the generic transmit
path - therefore rewrite the first 16 bytes at skb->data: a 12-byte
memmove plus two 2-byte stores at +12 and +14.  No caller supplies the
bound, while the pop helpers use skb_ensure_writable()/pskb_may_pull().

An IFF_TUN device has hard_header_len == 0, so packet_snd() accepts a
one-byte AF_PACKET/SOCK_RAW frame.  The first vlan push only sets a
hwaccel tag; the next - clsact "action vlan push" or
bpf_skb_vlan_push() - enters the helper with skb->len still 1.  The
head comes from skbuff_small_head without __GFP_ZERO, so each push
drags bytes from beyond skb->tail into the frame.  After three the
one-byte send leaves as 13 bytes carrying 11 bytes of uninitialised
slab:

  0000: 5a b3 62 12 80 88 ff ff 00 b3 62 12 81
           `------------------------------'
  only 0x5a was sent; the rest is slab, here the top 56 bits of a
  linear-map address

Require the MAC header the helper rewrites to be present, so such a
frame is dropped rather than transmitted.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Reported-by: co+0ea1ac045375cf05@bugs.sh
Signed-off-by: Xiang Mei <xmei5@asu.edu>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260915083152.705309-1-xmei5@asu.edu
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Alexander Martyniuk <alexevgmart@gmail.com>
---
Backport fix for CVE-2026-98377
 include/linux/if_vlan.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 3728e3978f83..2759d3846666 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -346,6 +346,9 @@ static inline int __vlan_insert_inner_tag(struct sk_buff *skb,
 {
 	struct vlan_ethhdr *veth;
 
+	if (unlikely(!pskb_may_pull(skb, mac_len)))
+		return -EINVAL;
+
 	if (skb_cow_head(skb, VLAN_HLEN) < 0)
 		return -ENOMEM;
 
-- 
2.43.0
Technical Details
Message-ID: <20261012163331.45783-1-alexevgmart@gmail.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-345109-linux-kernel-netdev=dewy.ru

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-345109-linux-kernel-netdev=dewy.ru
From: alexevgmart@gmail.com (Alexander Martyniuk)
Newsgroups: linux.kernel.netdev
Subject: [PATCH 5.10/5.15/6.1/6.6] vlan: require the MAC header to be present in __vlan_insert_inner_tag()
Date: Mon, 12 Oct 2026 19:33:29 +0300
Organization: Usenet Network
Message-ID: <20261012163331.45783-1-alexevgmart@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1826669"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:rR4TkNNLxeOKfVN3k4aWdkiEu0c= sha256:+hFpo4D7/oUJea8EziJ96/AUy6cfRUQtvBo3tU9ZMTI=
	sha1:tin4CedCOlB5n4pUE8ThvcytsHU= sha256:Tf49Z9p2WKjlI5U64wfVECrAl6z5RRSJkaM8lQt/97Q=
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 8381810FC60; Mon, 12 Oct 2026 19:41:24 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.748
X-Spam-Status: No, score=-0.748 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, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, 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 (2048-bit key)
	header.d=gmail.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 7H4PpW3LtXCl;
	Mon, 12 Oct 2026 19:41:16 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-345109-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 2360810FC5E; Mon, 12 Oct 2026 19:41:04 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sin.lore.kernel.org (Postfix) with ESMTP id 6C81E29D00; Mon, 12 Oct 2026 16:34:09 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id D8BAB4B4056;
	Mon, 12 Oct 2026 16:33:49 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eOqQxRuv"
X-Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D68D4B2CCE
	for <netdev@vger.kernel.org>; Mon, 12 Oct 2026 16:33:48 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791822829; cv=none; b=qHppGCiLFO3ATBhho3sAUytR5tWoLxbw1G5ML+MXGS7OCsiX9tnQqANudcQjPS1iQbaU1XRvf49fSP7SOTIaXSNaft5+g7pn9V5A9TBp/OsxmN4vpOQjasy12uETuC9jzs/FHATnfTHlxm9pHGv5SpmQLS7OUMhVzYSCRIgZkdk=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791822829; c=relaxed/simple;
	bh=XD7Dbp4kw/iRzxBqDKqco2WKsBeWlE1PFoG0b1uYEgg=;
	h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=E4MsOlZ69mPID7YIQe+z42mxtfMfbC/l3KcpreWgLuIXjBaLU7ISY980UfkZTGT6Wii0Om243kha9MwI2aIy8fv1SDfMNpBTe/ohV9qjaoxlami45IVWaE5mzhLPqgz6tZxJ9y5bDOfQRqMzx/pS5cwLmW+WKlrJqIC1eGAX1Vo=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eOqQxRuv; arc=none smtp.client-ip=209.85.167.44
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-5bcdab9a82bso2320077e87.3
        for <netdev@vger.kernel.org>; Mon, 12 Oct 2026 09:33:48 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1791822826; x=1792427626; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=UDyNt44SSPWd9NxVXjExVE9zSGlxnfJjDCgPSSUFpi0=;
        b=eOqQxRuvWRaQlTA0Uh7mlIPupRCYPkPMwllp43ImXYHX0xG0fkcZprKwZlb7vQZY+0
         /hInKHCFcJaetJm2qpmFO6kjKjMDN8pfKZh8PEm6svHeCl27OvFZhKOClBfz59OR5ifX
         9l0XjZAPX1Ya22P5hgbCosyiAYG2AkV/LES0dI9iFCCHiopuE/LW/LYbleWclV2Atceu
         NsXJUsGZynjheLf9WJSalEaC6EqWKYawrEAMW3I4BeHFIDkAW5PX9xU4NKzWso4kK2Df
         m32/bT4+ZcGULYgY6bwW1GHWF2zABtzBV54kW21hl0MFusxCWJu/dcNHQ5NcJWIEDM/+
         vV9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1791822826; x=1792427626;
        h=content-transfer-encoding:mime-version: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=UDyNt44SSPWd9NxVXjExVE9zSGlxnfJjDCgPSSUFpi0=;
        b=IpVyMZJXyz7D2eLOqNXVyCbm3SqNg4CJAkw26Z4a9ZtJshe8edEzXQSB36WeRyuzXf
         z8ORJCDv5a/NLcSQjYw68k9drZEChyCvZHRdS5jTC6lRwXX5Vn68NH6HzHaF/A6gQuPE
         MfFfx6n62NaZsFeCCX18YXSepBm2a60beOzv1lA4dwbPSwDgUBMNkcdMI8jRjPBQF2i9
         oQhjPVEF6pBi10bBsPTMb3PjeZYD9P1VMCgZm+7xatWlX3+qsh6ENsILyZsWfbEPg2rV
         +RcJHFKJYsqAMCzZlf/EmuP/Bi4fJTSQAsW6WLQSzM8Bd/wtgyg5fHfQPcFKAAitdcgQ
         aqwA==
X-Forwarded-Encrypted: i=1; AKwUvBwcey4Pr3nJo6d+06TbN5iRq5LTZWn0doKXRperiQmh+x3bEx1nrZYQvz+ngbZZ4ceCd2X+wVs=@vger.kernel.org
X-Gm-Message-State: AFq9FYIENvYvGD2xOMdJ9Pk/ZbcwBgF67Vh62a9pnHNi+Z9K52vK4Nk9
	ykFtxNto0sZ1WcTeTsYhmBrtVH78YeBJ1W/U9ZgLdfVF/dR9wjrHLYxE
X-Gm-Gg: AYBFou1cTwe8RVHAN8KjRwVXHli3KnAoeZpQSZvikomQ3T+VBkOGiwWko2ATEsgskKC
	iYfxlgbHJ3WBkRve7p7TYvOh0k5ne1keSxYlhCdbs6QFZnWLkMR6yFAWQTzcTAsSYb8xYhMsTeW
	mPfhWZE3qXJNWDJ3bn4YRbUWHA8gptbIHpfW7hgVm36aouLvKIU0klpOuNMxdjreMK2gTc9wcB3
	4jXnXkdjz7Sehf7PKKeBOS/gHNReebJda5opMuhVHyJB3B+jeXeJp9LC9dXl8zKAMdlLjYRumYJ
	+gEzdvRXgL1jgF18k9oM9uug8vapPz4t9JDKzX7i2yUX7qnFZGrIgpWuU/ol7oEfVM9j5RExuFY
	KQm+Vfh9a3lfSEvccC961ymJDajTncLiDdiENXcCHccYBTRJ/4OM6pubwfiNOfcv5me35s5Z9M5
	7cpHlMFVhAokkKRnK8l5mecInv1I7tLphw5s0dZzVdxQswsPYJZ5pWFbvpzqvXKh3UkfImCSTaK
	lI=
X-Received: by 2002:a05:6512:2349:b0:5bc:f6b6:411f with SMTP id 2adb3069b0e04-5bcf6b6426emr1063326e87.63.1791822825935;
        Mon, 12 Oct 2026 09:33:45 -0700 (PDT)
X-Received: from grower.uveon.ru ([185.32.132.3])
        by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5bcddea7d87sm3074897e87.48.2026.10.12.09.33.44
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Mon, 12 Oct 2026 09:33:45 -0700 (PDT)
X-Cc: Alexander Martyniuk <alexevgmart@gmail.com>,
	lvc-project@linuxtesting.org,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	co+0ea1ac045375cf05@bugs.sh,
	Xiang Mei <xmei5@asu.edu>,
	Simon Horman <horms@kernel.org>
X-Mailer: git-send-email 2.43.0
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>