🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #13294

Re: [PATCH net v3 1/4] net/sched: act_ife: encode configured zero metadata values

#13294
From: Simon Horman
Date: Mon, 09 Nov 2026 16:20
55 lines
10652 bytes
On Tue, Nov 03, 2026 at 06:50:29AM -0500, Jamal Hadi Salim wrote:
> Reported by shaos <shawnq1@163.com> with a reproducer for the 32-bit
> case, which was reproduced and verified in our test environment.
> 
> The issue:
> ife_check_meta_u32() and ife_check_meta_u16() both reserve eight bytes
> of metadata for a configured value even when that value is zero, but the
> matching encoder returns without calling ife_tlv_meta_encode(). The
> encoder therefore writes neither the TLV header nor its value, while the
> enclosing IFE length still includes the reserved bytes, exposing stale
> skb headroom contents to the peer.
> 
> The 32-bit helper has been present since the IFE action was introduced
> (v4.6); the 16-bit helper was added with the 16-bit metadata helpers used
> by the skbtcindex callback (v4.9). Both defects predate the oldest
> supported stable kernel (5.10), so they are fixed together in this patch.
> Each hunk keeps its own Fixes: tag for provenance.
> 
> The fix:
> Encode any configured value, including zero; skip the TLV only when
> there is neither a configured nor a runtime value. The runtime fallback
> is unchanged.
> 
> A raw TCA_IFE_METALST netlink request is needed to express the
> configured zero: the IFE_META_SKBMARK attribute carries four zero
> payload bytes for the u32 helper, and IFE_META_TCINDEX two zero payload
> bytes for the 16-bit helper (not an absent or zero-length attribute).
> Stock tc cannot build these requests; "use mark 0x0" emits no mark
> attribute and "allow mark" emits a zero-length one.
> 
> Conditions to recreate the bug:
> CONFIG_NET_ACT_IFE=y, CONFIG_NET_IFE_SKBMARK=y,
> CONFIG_NET_IFE_SKBTCINDEX=y, CONFIG_NET_CLS_MATCHALL=y,
> CONFIG_NET_SCH_INGRESS=y, CONFIG_USER_NS=y, CONFIG_NET_NS=y,
> CONFIG_VETH=y. In a fresh user and network namespace create a veth pair
> and attach clsact to the egress side. Install a matchall filter whose
> ife encode action carries a zero skb mark (or a zero tcindex) in
> TCA_IFE_METALST. Send a frame through the veth and inspect the IFE
> metadata in the received frame. The metadata region is eight bytes but
> holds neither a valid TLV header nor a value; it exposes prior headroom
> contents. Setting the value to a nonzero one does not trigger the leak.
> The namespace needs CAP_NET_ADMIN; no additional privilege is required.
> With the fix the zero TLVs are 0001000800000000 (u32) and
> 0005000600000000 (u16).
> 
> Fixes: ef6980b6becb ("introduce IFE action")
> Fixes: 6a5d58b67e20 ("net sched ife action: add 16 bit helpers")
> Reported-by: shaos <shawnq1@163.com>
> Link: https://lore.kernel.org/netdev/20261022144739.61342-1-shawnq1@163.com/
> Cc: stable@vger.kernel.org
> Reviewed-by: Victor Nogueira <victor@mojatatu.com>
> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>

Reviewed-by: Simon Horman <horms@kernel.org>
Technical Details
Message-ID: <20261109162018.GM18859@horms.kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359411-linux-kernel-netdev=dewy.ru
References: <SER-NSBD.v3.r0.20261103064310@mojatatu.com> <SER-NSBD.v3.r0.20261103064310-1@mojatatu.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359411-linux-kernel-netdev=dewy.ru
From: horms@kernel.org (Simon Horman)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v3 1/4] net/sched: act_ife: encode configured zero
 metadata values
Date: Mon, 9 Nov 2026 16:20:18 +0000
Organization: Usenet Network
Message-ID: <20261109162018.GM18859@horms.kernel.org>
References: <SER-NSBD.v3.r0.20261103064310@mojatatu.com>
 <SER-NSBD.v3.r0.20261103064310-1@mojatatu.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="400276"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:BaymfMdYrFp0eFjo/xQ60OhgvxQ= sha256:aznCrywz8hiavCKL6ynKZTSZXkBgktTGqvHxisZsF3c=
	sha1:icX/JCRrMrmxGuhDp0uL2PsGXN0= sha256:w3wFO4fgxPJNE7GoVoif84UppQtrU3NPdx0nNkoiwkw=
Content-Disposition: inline
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 A8CE411387E; Mon,  9 Nov 2026 19:33:46 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, 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 2Xh2xxYC7lL7;
	Mon,  9 Nov 2026 19:33:43 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-359411-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id A291311387B; Mon,  9 Nov 2026 19:33:34 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id ED8653309B; Mon,  9 Nov 2026 16:20:29 +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=1794241229;
	b=O0vb64VGtsvFrN4d8/nYgLpO/ti/x1ReKGGU/W1hLCkketufJodWAXs1Jk5qvWh7RU5C
	 TClSVmIywOJgE+sN64GFrluEP8CYGe/rXWDj/AXMv9ST/wctlhDWvDx5m4psVfF9WLIz4
	 6Fr4JuB2Q/eJYSDidKzDjSwl8Fnwu8FYY3G1Wt9RnyLlWzrkIDV7vIQctrjVVGlK+ZkeL
	 NiV6V/Gm7W7tqs3bKIFlvs8smGH7y1uiOFc32qWqCElcvz0yLK9B8pUHeHHB6z/JRPdH9
	 MTuRIjUpgXio4cWLgdK41DnCmh9fnaS+OoIlQCKD8AOS0hDw/FYGf8VzpbKf+KeFasA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794241229;
	h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc:
	 Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=lEhO3zAePXatssuxw4iweIsDZBb7ewU1Gz6USVWcZ8k=;
	b=DJyeMcULAIWTq40QwzSY9Bwo1tXnHwRgsjYoYv55G1tkNsPrgjUUesGq3M4unoPFtECb
	 m5/t7oF2hsp29QEppYBtIGPi5TMZFgBSQV8jN5mBqxob4LXLiEuvcuAFNsplDMpjgbtOl
	 cu3FW5TTUh3NqAGURvX4EVZcFzACd0kEf7R9iIuR+FVq8GAUafT8qutnz4WgLJnwmnMEk
	 HthwJ9N1Q1jfUpGfuPSPdbvbdeQfBIKHPN7fED/KQ1GsyQVSeMaNqsGcoLCrKI5Y3uAhP
	 5IGqg2alFiLeGz2xs955ciwVaPZSXnacJZ8klsJ1d+cOGv+g+nFEqUmiOP84w/knV9w==
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=GQB92kCB;
	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 3F444606A32A;
	Mon,  9 Nov 2026 16:20:29 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GQB92kCB
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=1794241223;
	b=2dV1llkamhKxOcz+zvobGscR/uw8Pmysvv/WPhCVN4CVwQCTMWRGKm8JDQTOo1k8i0vT
	 7WxyI4MOVr2t6mEHhZlXJuSSYz7kuHwKBJyVkX1aBOKU9Lv19gNna/P4sjAtnApUU9XMe
	 Ynve/SXysM7X5zwT6jjR6cqCvAy/vzICy0sQCydY3Olth6FT5WP7UKYHWkFEHSSv4RKZA
	 cDLu7F9db2XrXB9w7kMN/5sCWXRS1o/AQTSJ4tJKTeYXNpvkCa1vIPKA17J7juQx/FE5M
	 pMCXXPY3/HcY4esG8wJQkUbVoWrJzY3iB3YQbC7uT9VIGQjAv+Zl8lfVJqyzuyRU5Lg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794241223;
	h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=lEhO3zAePXatssuxw4iweIsDZBb7ewU1Gz6USVWcZ8k=;
	b=NLd3du+NzvNyiF0B+VjMAlwEtCV2xRNrxy3dWn076k3QWhz2WBQeRdU8W4oZY+mRnvIx
	 K8i+HioOJgd5nvtP8hhrdTJ2Mici6ylHet5lNG23jQ0HiiWe3muGpf+2WdRv2PNyhMIZJ
	 +XKG0f4sxFVs+D9xtJguE4rEj7dkke1aQo0HaRjqBluPUCYyBrcdWv54+xjWYNNvaVycB
	 X/f1XJxwlFe8B1eRxgCV7Xj0OGK4b3+pNnq9dmykFTjfhOYVdGMhcz7LBJd5Ljei9GxxZ
	 a9X7/LScXGXkimSXha6wk+Y+QYk4uxjLZzO/Rpo5wYTp6GvhjJNotxUWm7Tm6+ksKpw==
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=GQB92kCB;
	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 21BD7606A331;
	Mon,  9 Nov 2026 16:20:22 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB5521F0089F;
	Mon,  9 Nov 2026 16:20:20 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794241222;
	bh=lEhO3zAePXatssuxw4iweIsDZBb7ewU1Gz6USVWcZ8k=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=GQB92kCBXaxQfnGHPbMj1/jB72ewt8hGecEvv/jIniE1JV/h8zbfwQQKkRS6kI5lX
	 nvu9+KwGBm9MTJbEtuhgbBpsgJOKHMp4tz7DXOAhTkz5ZSEHubNAlE6GI+Tb9UHHGZ
	 /sLooxpIExxaO9e98PNO854bTdlyYpobJ5V3oytf3S7xWKNnYTljqq94xv2nC4n/by
	 awdLDWn/jsgEGzuBgUSiWj9YATEFf/OujGDh+K03hY/QyB+dXOZBT1OPRp3y8qe2rS
	 gTSHTAOtIOoorz8sM880ohzTse83lxVvrAUuatYzngZtIUPMRAp/UWLxGfKnMB/VWQ
	 C8DpP/6xt2cGw==
X-Cc: netdev@vger.kernel.org, stable@vger.kernel.org, shaos <shawnq1@163.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>, Jiri Pirko <jiri@resnulli.us>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Victor Nogueira <victor@mojatatu.com>,
	Tom Goff <thomas.goff@boeing.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
X-In-Reply-To: <SER-NSBD.v3.r0.20261103064310-1@mojatatu.com>