๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #7001

Re: [PATCH net v2] net: limit priority VLAN untag depth

#7001
From: Eric Dumazet
Date: Sat, 24 Oct 2026 08:22
37 lines
10178 bytes
Le sam. 24 oct. 2026 ร  02:49, Kamil Sawicki
<user148783812897@gmail.com> a รฉcrit :
>
> The priority VLAN receive path can repeatedly remove VID 0 tags and retry
> packet processing. Unlike the read-only VLAN protocol parser, this path has
> no limit on the number of nested tags it consumes.
>
> Each skb_vlan_untag() advances skb->data and resets header offsets. The
> offsets are stored in 16-bit fields. With enough nested tags, the network
> or transport offset can wrap. A later protocol handler can then derive a
> large pull length from the wrapped offsets and access memory outside the
> skb allocation.
>
> Apply the existing VLAN_MAX_DEPTH limit to the exceptional VID 0 retry.
> Count the tag already stored in skb VLAN metadata as the first level, then
> stop before untagging a ninth level. Keep the accounting inside this
> uncommon branch so the regular VLAN receive path is unaffected.
>
> A single VID 0 priority tag before a real VLAN tag is valid. No normal
> deployment was found that intentionally emits multiple consecutive VID 0
> tags; permitting eight levels is therefore conservative.
>
> The issue was found while researching the Linux network receive path for
> Google kvmCTF, with OpenAI Codex (gpt-5.6-sol) assisting the analysis. The
> affected path, reproducer and fix were manually reviewed and tested.
>
> Fixes: 36b2f61a42c2 ("net: handle 802.1P vlan 0 packets properly")
> Cc: stable@vger.kernel.org
> Reviewed-by: Willem de Bruijn <willemb@google.com>
> Signed-off-by: Kamil Sawicki <user148783812897@gmail.com>
> ---

Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Technical Details
Message-ID: <CAL4WiiosFWCD1Eh2KqepZupiZm0de7bUs72fBgh1AOQkL=BCzw@mail.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-351322-linux-kernel-netdev=dewy.ru
References: <20261024004835.17862-1-user148783812897@gmail.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-351322-linux-kernel-netdev=dewy.ru
From: edumazet@kernel.org (Eric Dumazet)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2] net: limit priority VLAN untag depth
Date: Sat, 24 Oct 2026 10:22:45 +0200
Organization: Usenet Network
Message-ID: <CAL4WiiosFWCD1Eh2KqepZupiZm0de7bUs72fBgh1AOQkL=BCzw@mail.gmail.com>
References: <20261024004835.17862-1-user148783812897@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="717664"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:aBlM1WNzwv28q3sOnizfffjJIdE= sha256:2A3I5yNuM8scHSCceBLbwlYKfJhGPfzHY2sn0jGxrk4=
	sha1:D/7fYIEnq+k7byxhFs/6XuYmsKY= sha256:lrHylyKEtKwo/Fd9F2+ruWWlpzCSnU+5PrIi2R97zl4=
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 8299E1115FD; Sat, 24 Oct 2026 11:23:37 +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 dqpo7UA788-f;
	Sat, 24 Oct 2026 11:23:30 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-351322-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id A88721115DE; Sat, 24 Oct 2026 11:23:18 +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 A29583DB64; Sat, 24 Oct 2026 08:23:01 +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=1792830177;
	b=avZP581SH/9+9oE9x1o5DuMjMiuO+oUFtCbOBPkVNuZJxsWOKglUDBh2vAyPR4H8nZFY
	 zw2No7NfHsjaqCUJhBWNLhAcqdZkiPbBCQX0kFHFHI1kJaICv4mIAujII/w4WcY8N6E6r
	 k//Pf41j8QMby9a3hfEgS4ONXVyCcnoOenL+1AcQk9wu/s91skJ90mAKe1h63ZTWre3tM
	 MFR/04UYFqtu+mN0FNdNJ6XXsz39TmM9EfBTw0gpF9rqFzUUuWHiya+x5fO+sv8XFJj4P
	 ctfGmdGsfQNPwePB3y8iSI3/jwvDrC25qn9xAh0Lek0iyeRGFCRYM1YPtgaxzIcw6DA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792830177;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:
	 X-Gm-Message-State:X-Received:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:References:In-Reply-To:From:Date:
	 X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:Subject:To:Cc:
	 Content-Type:Content-Transfer-Encoding;
	bh=Pf9LCz6OljNAat3cS0OtJ2Vbp0Q0oJbVMd/1ym7N+sI=;
	b=FB11D+kLez8tv63r8LsNeILjeL2I+xFa8j3mk9LXXHhHW3oRNu9qgM8Mt/7iF+rTfZrf
	 Hpe8t4j5FwKCoRCtBZIFJpkHG5Ng8HKd7XCi0mPVDkzt921eJPOFYGVDGTJ8gOv8kpYSx
	 knrXlSZf+UK+3wDDthvGybfnQGLHh95+3Kaara0Vakbs7Y42L16CCZZ82HAGudSnNF75t
	 JMfqzfP1dmzVF7RdmP2oub0uOx6QzKe0vwzMUydH6DwGqYfEQwT/nimFG+8iLnq1dZOJK
	 F8JUGwKbJV30SepyQPoH5WZdXba4IoKW1ngBOG0fcZAcaX4baGjf8nDjzHUdT0DTmvA==
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=NUj0GwNH;
	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 B551B606A33A;
	Sat, 24 Oct 2026 08:22:57 +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=NUj0GwNH
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=1792830176;
	b=WGjd/GCpAr6nhm0WuRrCzWLCEPYaWp8Gcw1eP9Y1An8qUrqajV7ZyUJjW7hsRflvav/j
	 3lL9hrD5dYd4nZ8UW9JtYB4KNnlXlIvEeLhQD6vkC8QayHuC2R1eUyT+ack2SpYjG6xCL
	 sRiHZA0A2Y5TaBtlrkahXLiRLSDR24THerCw8ZmbjFLNe8X0PGqbxM8RLD1AgngwK4hZn
	 t1+qTjPFEr1CXskv640KX5lIfCkWfPT5kJkzcET1gw67YA6R9yQpg8R2tDJLriwJn6asf
	 q+yaoAglVmDpAKW31Bux/6rhzN4SqG+abkOb6kWkKvhGtR0m7NS1Yvu1Spor6K7Yqiw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792830176;
	h=Received:DKIM-Signature:Received:X-Gm-Message-State:X-Received:
	 MIME-Version:References:In-Reply-To:From:Date:
	 X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:Subject:To:Cc:
	 Content-Type:Content-Transfer-Encoding;
	bh=Pf9LCz6OljNAat3cS0OtJ2Vbp0Q0oJbVMd/1ym7N+sI=;
	b=km9Z8NtOGAZYfMg4mZQdW10U6TU24njolq6CuCViaEXe3bVb5q7RRQrH006qybHjP1yr
	 /JlsXN5KMjKdny13DS68iDvL1g9ovXIRTkgA0B+nUUTnjR5OrHstkBni26IYvTofFqnb0
	 DgjUz6dezRBJ7xwF8xnqnbObvjeE0qr6IykTvTeqYSA4Ukai6aE70oJ3W2F8F9RIOBrex
	 j0qaeMIngmcnd9NNlivC2Dp/9G2hqSQVwB+sKp3wo0Fo4Ob0U/mwub7RF/Lx0nB9jAay4
	 DyUYQRawsdofHGjRAEbnFqmyLtq3W6bjQ+teNHBoGPcrgNQVZ99HYjz+xxfCWKSMF9A==
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=NUj0GwNH;
	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 98832606A32D
	for <netdev@vger.kernel.org>; Sat, 24 Oct 2026 08:22:56 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76F4A1F01825
	for <netdev@vger.kernel.org>; Sat, 24 Oct 2026 08:22:56 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792830176;
	bh=Pf9LCz6OljNAat3cS0OtJ2Vbp0Q0oJbVMd/1ym7N+sI=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc;
	b=NUj0GwNHiilp3mi4pm0JKQ6caF/pYBln0+rOAi4unFZn1RnqYjrneOoz/Sy46m3y4
	 kugGNCwtM5j8Uip/zHgr1rYJ2HVueZEMbWrZO0MDQwH2r01IPOW+kifUlco5dwcpuh
	 Iio2QH6nFG0g7O2Ei6dhCwkQOYvbknSQAT/gE+QBzqv/y/3gko7TMzIgfKOF9oACTB
	 EpPvAA6cbd+MIEom5IrMCdf7mF+CDxodaxOUF5zMdCC8YY92d/MmClaqxBKZYE7FLz
	 Jpdhk1n8fhLQtRN9NGQnTglhS/cUaJ4h3bthistMfdwTW4Z4Ek+fP+cVjbOmiEYpR+
	 +b0daNoIIAOfw==
X-Received: by mail-oo1-f41.google.com with SMTP id 006d021491bc7-6de1fd5f572so786127eaf.3
        for <netdev@vger.kernel.org>; Sat, 24 Oct 2026 01:22:56 -0700 (PDT)
X-Gm-Message-State: AFq9FYJG1+FzzWThrbx39dVwBlVeLvQu189eLXfEqo8MnagQlvPpCSGf
	Gb7nv9eJTKVb5nC1v30xnFRbk/Qlmr8Z9Bj1zfw+Mj8SG1eeLctCQGgd6+7h+AWvoARVVfOVZzn
	qs7GF4nU9K2K9IMWKlKj9PyenlUlZH6U=
X-Received: by 2002:a05:6820:351a:20b0:70a:4053:52d2 with SMTP id
 006d021491bc7-70ba0f0e13fmr382361eaf.72.1792830175840; Sat, 24 Oct 2026
 01:22:55 -0700 (PDT)
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
X-In-Reply-To: <20261024004835.17862-1-user148783812897@gmail.com>
X-Gmail-Original-Message-ID: <CAL4WiiosFWCD1Eh2KqepZupiZm0de7bUs72fBgh1AOQkL=BCzw@mail.gmail.com>
X-Gm-Features: AclHuK-oQLgWnV9Q5oHz0rKQ-UF_EVKTiTNU1RJpEcLfw7kcKwftdg32nKc4AEs
X-Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, 
	pabeni@redhat.com, horms@kernel.org, willemdebruijn.kernel@gmail.com