Article View: linux.kernel.netdev
Article #23747Re: [PATCH net-next v3 05/11] net/mlx5e: TC, reject a partial tunnel key with tunnel mapping
From: Alexandre Cassen
Date: Fri, 27 Nov 2026 22:19
Date: Fri, 27 Nov 2026 22:19
42 lines
10640 bytes
10640 bytes
On 11/23/26 22:34, netdev-bot+sashiko@kernel.org wrote:
> [Severity: Low]
> Is this check too strict for VXLAN and Geneve? It compares against a
> 32-bit all-ones mask for every tunnel type. Those tunnels carry a 24-bit
> VNI, so a mask of 0x00ffffff already covers every bit a packet can carry.
>
> Both parsers run before mlx5e_get_flow_tunnel_id(), and they already
> reject keys that don't fit in 24 bits:
>
> mlx5e_tc_tun_parse_vxlan() and mlx5e_tc_tun_parse_geneve_vni():
> if (be32_to_cpu(enc_keyid.key->keyid) >= MLX5E_TC_TUN_N_VNI) {
> NL_SET_ERR_MSG_MOD(extack,
> "Tunnel key does not fit the 24 bit VNI");
>
> The mask is then written into fte_match_set_misc.vxlan_vni[0x18] or
> geneve_vni[0x18]. Both fields are 24 bits wide, so 0x00ffffff and
> 0xffffffff program the same hardware match.
>
> This means the masked key stored in the tunnel mapping is the full VNI.
> key32_to_tunnel_id(key.enc_key_id.keyid) in mlx5e_restore_tunnel() would
> give back the packet's real tunnel id, so the wrong-id restore described
> in the commit message can't happen with this mask.
>
> Once the flower enc_key_id mask patch later in this series is applied, a
> VXLAN or Geneve rule such as "enc_key_id 42/0xffffff ... action goto
> chain 1" would fail here with -EOPNOTSUPP. The same goes for a sample
> action, or for any such rule in a chain above 0. With skip_sw the rule
> is refused, and otherwise it stays in software. Only GRE uses all 32
> bits of the key.
>
> Could the check instead require that the mask covers the full key width
> of the tunnel type? No later patch in the series changes
> mlx5e_get_flow_tunnel_id(), so this limit is still there at the end of
> the series.
No as on v1 and v2 [1]. The exact key matches the same packets and this
works in chains.
[1]
https://lore.kernel.org/netdev/3b3dff0d-e879-4a14-9f17-2b3015b6da39@corp.free.fr/
Technical Details
Message-ID:
<3c82dec8-e3b9-4095-ad40-232dcc811f13@corp.free.fr>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372958-linux-kernel-netdev=dewy.ruReferences:
<20261122213200.3207385-6-acassen@corp.free.fr> <179546966530.3135.14742631609975673237@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372958-linux-kernel-netdev=dewy.ru From: acassen@corp.free.fr (Alexandre Cassen) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v3 05/11] net/mlx5e: TC, reject a partial tunnel key with tunnel mapping Date: Fri, 27 Nov 2026 23:19:43 +0100 Organization: Usenet Network Message-ID: <3c82dec8-e3b9-4095-ad40-232dcc811f13@corp.free.fr> References: <20261122213200.3207385-6-acassen@corp.free.fr> <179546966530.3135.14742631609975673237@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="832355"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:V+q/XMy/7dCuCt8vUdWSM5VRgLw= sha256:5Ar/NMC4AJ/I9myHqYMIA959u6xOvZx587q4S5gxCcc= sha1:cG8zuONvIzLXR7cC0DnY/RMU+3M= sha256:DTzIm+ATBHwHFe0GGR7KpkQEVT6QhiMt0WUeWas5hXA= Content-Language: en-US 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 75037125F66; Sat, 28 Nov 2026 01:20:17 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.151 X-Spam-Status: No, score=-3.151 tagged_above=-9999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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=corp.free.fr 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 K2MXvyEhBCVw; Sat, 28 Nov 2026 01:20:13 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-372958-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=corp.free.fr X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id CA8BC125F65; Sat, 28 Nov 2026 01:20:04 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 4B6AA603D87; Fri, 27 Nov 2026 22:20:04 +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=1795818000; b=P5zZO8ZK8IbsoGcx561jPFuYtI3xkhq2g4h7CXOr3QFD7T1Hj2+nQrUxrKEgCIvQYD48 zzfFmzWBze7gqm1M8lIoJybIYB0iJlrPApYAC9uUWq/gpnA8BYdpfoQcZLtA5JG7yVCVx 3LZ6CwwKjiq5ayGTLZH7880jeqBMBywnZnYfKecAscGXRtvowczQbWVXObM9i6otufnop Dokn0DCmNVPBx2jH3WDM2ZFLnzYYlBY2xAf3UFm+Ax5kSXzvITLLX5GsyzVd2ntDCJpGP 7Ok2BoNUb4mIcG/UgFVZTlisfmqyIE6AP8ewVpaneQwDsExEB08q6E8XUtia1N4Vv1A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795818000; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received: Message-ID:Date:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=Vcatt8Yseeu3grJzN3DTmydm5PfHsbdoMOyAc0A57NA=; b=c34py8dHsvTbSDMJVGT0CMTD260mYkjUmg0/6bebBJX8BLjITraqyObQnOaCW90iaHR/ dXsGhjiRCoJ/X2RS0YT36G3xxIPF448cK8r25n9B6tI+IJh6dOB2V+CJNK44qPp9dhlUM rXWENF3yLlNcsdzljLiAKT3G5XrueP9ENKamfEAN2682Y0dn56IY1/M7KODJjgv51U01R peaFtNmDzBaURb48+UmEil1EVOFtJD8xJeRM4Re85xJUsAYYY4pZYkX3gkMfJmjwinBQv 8ZWZ2p5g/aFbVffewK4ajCfjk5XYtfG+rpvYjVvgKQ/JnekblHvhisoG7ikI/+JtAkg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=corp.free.fr header.i=@corp.free.fr header.a=rsa-sha256 header.s=rcs header.b=Nx1oBwoL; dmarc=pass header.from=corp.free.fr; spf=pass smtp.mailfrom=corp.free.fr; 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 D8657606A332; Fri, 27 Nov 2026 22:20:00 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=corp.free.fr header.i=@corp.free.fr header.a=rsa-sha256 header.s=rcs header.b=Nx1oBwoL X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=212.27.60.169 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795817995; b=b8xYJKXLLUVzJB9G6sXTDo8DUBQnhshPCcxSvmvNp80jtbxLevxfFTtog5yeJ5f0HFfZ 3lehchDBfbFJwBbxKa8Hovx+wwIIhKOojAlNbQWtre1DbYV0TB9U4s/ilCmBi3DkJpeyd AB6PTjZ+vb4Yx5K1pJJaMX40sbbzmofBWhBhhqEKYWo3ul85RJgTAJx9KEwnxp8y4QvO9 UQWo9ktj3+OM6VuEWHwQ9hc+/RpHu1BSmuy1FUPk6BTZRkgsHWZe05Q0JCsXeM77CzhcY lxYCjGlz9zHW92/H6NzS9+KexQdmkThZIvje/pAr1EyHPLcAtADTX7zHlk5rTiWsOUg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795817995; h=DMARC-Filter:DKIM-Signature:Received:Message-ID:Date:MIME-Version: User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=Vcatt8Yseeu3grJzN3DTmydm5PfHsbdoMOyAc0A57NA=; b=T7CwTpz2+pYjUNbqyOfnxB8WKwQJecaxyWQb+ARKkmtPd6hnuyGZ3lUa9mgDAGDsQKwr 6RWcZ+1B1d8/9xcciocBiBj4Le/hjUh7zmBU3IoEasn2N4FdzkW2Z9BpdviIG5G7FPu3/ JXZDPx6VgfSrp/4USzUP/J6rgJDDIhrhzmLCHz7lIuNnyAX3/J15jwtgtY9uxTtVubdb4 zNizpS9KUpyo3u8v4MZ+srHglk0+pjgD0kvzfKYgnBRaHxFo2LDQKK+UhgykNH5zRUUux oxlDzfYBhUo48J6v4GQpS7/BWuGesyTk2O/ZyT+sx0g4d02ZEoL+fX6MkmOSsI0wzdg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=corp.free.fr; spf=pass smtp.mailfrom=corp.free.fr; dkim=pass header.d=corp.free.fr header.i=@corp.free.fr header.a=rsa-sha256 header.s=rcs header.b=Nx1oBwoL; arc=none smtp.remote-ip=212.27.60.169 X-Received: from rcs.proxad.net (rcs.proxad.net [212.27.60.169]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BEFAC606A323; Fri, 27 Nov 2026 22:19:53 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BEFAC606A323 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=corp.free.fr X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=corp.free.fr X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=corp.free.fr; s=rcs; t=1795817986; bh=VeQyV1mK6VqRPBq7e4DAfTGfLV31JYzS0eyZ60VjWkc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Nx1oBwoLHoI7ZVYWfrmJtNjkBGdp2lVkR/VnEedfRGU1jG69wYyIRZ8zQ+bhCYt1y DAdiYW9jXt1H1vhddY2NB5kk1rsV8ygcp9W4TT+HK6oVDiARIeZbLCaFbhP2IbQF2P M5fJtldf7n4O3HeNL1B1Ws/luqWAupjpm1cXRIOrOlQh28hzoAxwNk/5Qz7ByTlvBb 0PVZtUJn7frCZFCxJwtocycW+pSl1Nnc4i5TE5pOVIThXSu/HijWT9kbs6HfIa8ckA Cn5ct07ehiJVFUmZnhBB9vVbMRaJb8xk10ixVsvVt9WpxLB1UMaP5NLRLAWHTqTOdP hwPfnq4NAzzzg== X-Received: from [0.0.0.0] (unknown [213.228.1.188]) by rcs.proxad.net (Postfix) with ESMTPSA id 45D0344C0E09; Fri, 27 Nov 2026 23:19:44 +0100 (CET) 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-User-Agent: Mozilla Thunderbird X-Cc: saeedm@nvidia.com, leon@kernel.org, tariqt@nvidia.com, mbloch@nvidia.com, jhs@mojatatu.com, jiri@resnulli.us, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, michael.chan@broadcom.com, pavan.chebbi@broadcom.com, bharat@chelsio.com, donald.hunter@gmail.com, corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org, dsahern@kernel.org, idosch@nvidia.com, shuah@kernel.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, oss-drivers@corigine.com X-In-Reply-To: <179546966530.3135.14742631609975673237@kernel.org>