From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E8183CCFA3 for ; Fri, 3 Apr 2026 16:26:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775233589; cv=none; b=Av2iWYNs6TszeS0lmWiTAxvdSfoYQRvWpCg8gfhOpyLfG8JPaGnxh9PQAYDvCLkaypIjl3UZJV2rWHqa4ySoD6iIRY6yZJhlgKoX+TswVS9lOwgAg3r5M1kBjfowyK2egVTGuwQ0vmKxmUBVmioQD5UwRbzGSIqDaRsvUWBn8Vk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775233589; c=relaxed/simple; bh=PQI8hQoKKs0qI4ILdyv4HJHsJNSJoJIs4raAItgmIss=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aW4GlCtbyxdX3lh0CEkykx38XqfEiN5I3z6jt2qLVwBSm7jweXHW/G2p9DKaF+KP9RAsgzqiFLIb8p/xYKAtnamP4R2Px6QNzWo7Ty1Mj2MXApA8FSCOLSTz7ILI6NhsCbYeyCsAWJ9zuoCiZ15ppiIhltZTZoeZeGJGfSnCaqU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YaTQQxIN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YaTQQxIN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBF7EC4CEF7; Fri, 3 Apr 2026 16:26:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775233588; bh=PQI8hQoKKs0qI4ILdyv4HJHsJNSJoJIs4raAItgmIss=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YaTQQxINOeWP6B7PclF6HmREFfoquk3E/N9saH5emM0RPcG+eiPjU7D+QqHrv3NrU qdk7yHEq3t/uktAHhvJxshdXJTPHHfF52kAZT1XLcTguJN/dJSvDOTS1jlQCdvW8SL eqAFq2G6L4eWhnEP2rfYrE4jOE1IrC7hJXDsSIbK4f6expMEo2qGoTipy+uXc6qr/q B3Fh/R7udRHi0o4U3GYp+ebeetLUyakV4Alu/QCvOAxVf8S8xPfdV6MYy5WDHnaMQZ +4baEPmbvM/Q67TpCn4sUpLATVQ7bXJ2jClMFBpbPcx0VUpagXxnl/Ul47yaE+cmaI ik6vn2YYRXweA== Date: Fri, 3 Apr 2026 17:26:23 +0100 From: Simon Horman To: Ren Wei Cc: netdev@vger.kernel.org, jhs@mojatatu.com, jiri@resnulli.us, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, elibr@mellanox.com, yifanwucs@gmail.com, tomapufckgml@gmail.com, yuantan098@gmail.com, bird@lzu.edu.cn, enjou1224z@gmail.com, caoruide123@gmail.com Subject: Re: [PATCH net 1/1] net: sched: act_csum: validate nested VLAN headers Message-ID: <20260403162623.GP113102@horms.kernel.org> References: <22df2fcb49f410203eafa5d97963dd36089f4ecf.1774892775.git.caoruide123@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <22df2fcb49f410203eafa5d97963dd36089f4ecf.1774892775.git.caoruide123@gmail.com> On Thu, Apr 02, 2026 at 10:46:20PM +0800, Ren Wei wrote: > From: Ruide Cao > > tcf_csum_act() walks nested VLAN headers directly from skb->data when an > skb still carries in-payload VLAN tags. The current code reads > vlan->h_vlan_encapsulated_proto and then pulls VLAN_HLEN bytes without > first ensuring that the full VLAN header is present in the linear area. > > If only part of an inner VLAN header is linearized, accessing > h_vlan_encapsulated_proto reads past the linear area, and the following > skb_pull(VLAN_HLEN) may violate skb invariants. > > Fix this by requiring pskb_may_pull(skb, VLAN_HLEN) before accessing and > pulling each nested VLAN header. If the header still is not fully > available, drop the packet through the existing error path. > > Fixes: 2ecba2d1e45b ("net: sched: act_csum: Fix csum calc for tagged packets") > Reported-by: Yifan Wu > Reported-by: Juefei Pu > Co-developed-by: Yuan Tan > Signed-off-by: Yuan Tan > Suggested-by: Xin Liu > Tested-by: Ren Wei > Signed-off-by: Ruide Cao > Signed-off-by: Ren Wei Reviewed-by: Simon Horman