๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #7762

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

#7762
From: Eric Dumazet
Date: Tue, 27 Oct 2026 07:06
45 lines
10581 bytes
Le mar. 27 oct. 2026 ร  02:40, Kuniyuki Iwashima <kuniyu@google.com> a รฉcrit :
>
> On Fri, 23 Oct 2026 20:48:35 -0400, Kamil Sawicki wrote:
> > 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: Kuniyuki Iwashima <kuniyu@google.com>

Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Technical Details
Message-ID: <CAL4Wiiqu-tO8pVaLpGeeKneuSY+6X-1OchyXf6zNG9mfq=CQXg@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-352254-linux-kernel-netdev=dewy.ru
References: <20261024004835.17862-1-user148783812897@gmail.com> <auAA6ww0o6W07hGF@google.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-352254-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: Tue, 27 Oct 2026 08:06:52 +0100
Organization: Usenet Network
Message-ID: <CAL4Wiiqu-tO8pVaLpGeeKneuSY+6X-1OchyXf6zNG9mfq=CQXg@mail.gmail.com>
References: <20261024004835.17862-1-user148783812897@gmail.com> <auAA6ww0o6W07hGF@google.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="1483044"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:HPaVFDtKSgiO6ah6MOIvzJrTaXA= sha256:Rq82sD2q/RA5Mm8G+Sy1FIn2AIH6nK0ON6BvjeSOAiQ=
	sha1:Fhl6GBTG9ktKkIXteoH80rijNys= sha256:ZBnsDZ+kJ3WCOKJ9ehrXkmM2bLV0Pr6plcSmkgPTGFw=
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 33B20125BDE; Tue, 27 Oct 2026 10:10:22 +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 5MLAr9xoHqjN;
	Tue, 27 Oct 2026 10:10:14 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-352254-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 874FD125BDB; Tue, 27 Oct 2026 10:10:05 +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 32B5829B66; Tue, 27 Oct 2026 07:07:06 +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=1793084826;
	b=XKu0GEWwcFEBY6Eo6kJo24j6gxYd/2KA602ZbqyVnq4ql0BMsqQF01agjhS9ve6JTINK
	 J4bmho1J/pj0/HQOIDo/LZ1ls7ec+QoXUso4A9VR87KgJwNHTBjEE7ulU6SAIebGN0FSn
	 GoDo/+3DzLpTUeMAVtih8+XiP8jWEhVsR0O/y3FP16lslF750tzuldDmbKWO8PTtjdoFJ
	 HiUled9m5vS0uzUuc+tlEksrFxGu67RnrnJhdu79Zu3bv6YOe6EVLCvA/LyinrUzgV42s
	 QfplxaCvqR0oBNBRND+HNZLdcZU8OoeE5JjyDP8SPRbUISj7JGNabHTfaTtHbrAHGog==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793084826;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:
	 X-Forwarded-Encrypted: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=Haij1UMGI31cJqxu2zopCZgwJAF8QICo8mOxt+3rrII=;
	b=HUdtLU5TTGd1wvrRvZpwUMPVUA0Oas8hiTPUQhGMUqXNz8Qwm6kbr+h805uLgvTpQoA7
	 gVTn6zw22WSHVJTq+1/idAyxYQNa+VAelsIRHL/97tdX+pc49Y9sTVRQkdIJVag5stMzi
	 MdmtN/IvZC40DCjewl3LJRLpilIBmYuHPHBC030DGIgr1UDESoA0ysuM6//eIOSKpyYl0
	 AqXGocU55oXeQOo1brg5BV7FKdrL0vbMR/xkh+F9wBgZRE8/WQrPQmGZSrBnaGGzoDUIq
	 1pgWGxjFVKZXjvLeqS3ZdWfAaG7NueUtF1Yjxme7ZRk80OLleAbWvn46JSLRVTahr9Q==
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=fT0F8iCo;
	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 0AAC2606A321;
	Tue, 27 Oct 2026 07:07:06 +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=fT0F8iCo
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=1793084825;
	b=smpZyhnqgJNPSHX18xaLtLNl035WfN+ZxzLxE4YkUmZtpdn5qJ6APbOIdO2RFwLMdCuk
	 IBMScPBBFJ7Ochagk2G4eNtlhy4QnxB/qU0O/yf4e86d33nLrRHnPyJzglmaYG1Y3KiU8
	 GU315r8BfawjtVa9rgoWSAPQc0uyXwE32wJ5/VWrxHKhvm+VdOLAsQ5LK2JkT2WbFLdnM
	 +mYImzR/AFizIsbp1siRCgKhG2NwlOM3sWag8o/9b0KJhwi+W2w0dbpQQBLCd9H4EURer
	 nrgCfkf+YO0zwUYEmcYnx8ehij9WB6CFf3jClBtPNjIbe/XM2JG6Zd3Vet091QURrHQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793084825;
	h=Received:DKIM-Signature:Received:X-Forwarded-Encrypted:
	 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=Haij1UMGI31cJqxu2zopCZgwJAF8QICo8mOxt+3rrII=;
	b=fFCr8R24fuM5ZxUa0++UVkAw45PDRS/6awZEc+OqyGCWcuLZS4u7ws1oM0M+Vi2qaMwJ
	 n3WebbIRxD2/buMcWIu7JG+n6RyyWw2l+ulZNYapZ5z/sBc3IPKo2BF2xyCwKeBnmNrJ3
	 cy3R4Cvjl2RCJQgXCsPS0tNvBFMRAzgpZkx3CmFskImz+YrFiHcP9ftY8EBddtOZab/ho
	 i36uV/8FkqZMhh3nE7dorhWUwv88AWDdhuJDzAjARpDG3uIlQn01eCj2LwbmPvDLCyfVp
	 A0Fq3JZUShagPMgnP4Qo/MDvKxGJUbPjNtcCJsXGF/88L6PnSe2qWmBNR+58DFyzA9g==
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=fT0F8iCo;
	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 DEE53606A31A
	for <netdev@vger.kernel.org>; Tue, 27 Oct 2026 07:07:04 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 666B41F01825
	for <netdev@vger.kernel.org>; Tue, 27 Oct 2026 07:07:04 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1793084824;
	bh=Haij1UMGI31cJqxu2zopCZgwJAF8QICo8mOxt+3rrII=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc;
	b=fT0F8iCoZMuj8/wjSjb0BHVbhQV1zhGjDM5Hz/rdImckfkHN0Zdf/dcmjUHswKHf3
	 9iFeHMtT3t2F1LWeUm5k8g5W4rG37JDhwuVsy3SoF4KUH6NTYXwYh7oJcX7lXLDp1P
	 TJUTpHxP+bJ5g1eoCJxUV92G4xTkzV3T63L0yrgphrY3V4UsCummnirAXWNr/PGPux
	 lJ2QQo8pUm03ri9UpY1Fgp6AaSeMSN25tAe0bBHNePHWge20FEIW3I3SfnHAHuods1
	 Wx5pE/K2PoYHgf95+kDqs9/GPmxnLn4FY8eHp6hLsh78fKz/CCQNWqB8UoqzDz98ae
	 s6T6gEHnPIxEg==
X-Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-483a66818edso1885496fac.0
        for <netdev@vger.kernel.org>; Tue, 27 Oct 2026 00:07:04 -0700 (PDT)
X-Forwarded-Encrypted: i=1; AKwUvBwxbJr3GzHH15rj1bN3NbLLhq0tGL7i/diQe0uomsfaeuee6i3bgB4Sa2d9d+tap2jE//NQbTU=@vger.kernel.org
X-Gm-Message-State: AFq9FYK5zU4N6LhvbKy+pIA1VV59TCX61Lb2dgC7qXaHt9Gn6cW8KWq8
	W3JpFtkLFPkYtVH7Ia9aSTrfn+xs4J6rtLRuwBYcI1/yqwaYQHgIz+kypL1KOrMwjj+R0DuBaXP
	Oyk6LM63DM6m2Y5R3Fl7xMmcRx/5DPXQ=
X-Received: by 2002:a05:6870:1641:b0:497:4b0a:61fa with SMTP id
 586e51a60fabf-4a83f48b0b9mr5659905fac.28.1793084823789; Tue, 27 Oct 2026
 00:07:03 -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: <auAA6ww0o6W07hGF@google.com>
X-Gmail-Original-Message-ID: <CAL4Wiiqu-tO8pVaLpGeeKneuSY+6X-1OchyXf6zNG9mfq=CQXg@mail.gmail.com>
X-Gm-Features: AclHuK9tZmdKALCq4z_lDeF2v4rWTvmmDPqjsb821Np52nbuDnodqoxjrRygB3U
X-Cc: Kamil Sawicki <user148783812897@gmail.com>, netdev@vger.kernel.org, davem@davemloft.net, 
	kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, 
	willemdebruijn.kernel@gmail.com