Article View: linux.kernel.netdev
Article #16587Re: [PATCH net-next 03/10] nfp: flower: refuse a tunnel key wider than the VNI
From: Alexandre Cassen
Date: Sun, 15 Nov 2026 09:06
Date: Sun, 15 Nov 2026 09:06
51 lines
10901 bytes
10901 bytes
On 11/11/26 20:12, netdev-bot+sashiko@kernel.org wrote:
> [Severity: Low]
> The commit message says "An exact key above bit 23 already selects the
> wrong VNI", so this check also fixes a bug that exists today. Should the
> patch carry a Fixes: tag and a stable Cc so that stable trees get it too?
>
> Before cls_flower accepts an enc_key_id mask, fl_set_key() passes
> TCA_FLOWER_UNSPEC as the mask attribute. That means any enc_key_id that is
> present always gets an exact mask:
>
> net/sched/cls_flower.c:fl_set_key() {
> ...
> fl_set_key_val(tb, &key->enc_key_id.keyid, TCA_FLOWER_KEY_ENC_KEY_ID,
> &mask->enc_key_id.keyid, TCA_FLOWER_UNSPEC,
> sizeof(key->enc_key_id.keyid));
> ...
> }
>
> nfp_flower_compile_tun_udp_key() then shifts the key and the mask left by
> NFP_FL_TUN_VNI_OFFSET (8), which throws away bits 24-31:
>
> drivers/net/ethernet/netronome/nfp/flower/match.c:nfp_flower_compile_tun_udp_key() {
> ...
> vni = be32_to_cpu((match.key->keyid & match.mask->keyid)) <<
> NFP_FL_TUN_VNI_OFFSET;
> *key |= cpu_to_be32(vni);
> vni = be32_to_cpu(match.mask->keyid) << NFP_FL_TUN_VNI_OFFSET;
> *key_msk |= cpu_to_be32(vni);
> ...
> }
>
> So on current and stable kernels, a VXLAN or GENEVE rule with enc_key_id
> 0x01000005 gets programmed into the NIC as VNI 5 with mask 0xffffff00. The
> hardware then matches VNI 5 traffic. In software the rule never matches,
> because VXLAN and GENEVE tunnel ids are only 24 bits wide.
>
> The Fixes: tag would need to point at the commit that first added
> VXLAN/GENEVE VNI matching to nfp flower. Commit 77a5f73a8b33 ("nfp: flower:
> move udp tunnel key match compilation to helper function") only moved this
> code and says it makes no functional change, so the original commit is
> older than that one.
v2 adds Fixes tags for 611aec101ab7 ("nfp: compile flower vxlan tunnel
metadata match fields") and bedeca15afd8 ("nfp: flower: compile Geneve
match fields"). Both predate 77a5f73a8b33.
The series stays on net-next, with no stable Cc. The bug needs a key
that no VNI can carry, the rest of the series depends on these checks.
Technical Details
Message-ID:
<3c188745-3c7e-4105-be09-60a8f9d435e9@corp.free.fr>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363623-linux-kernel-netdev=dewy.ruReferences:
<20261109131039.959438-4-acassen@corp.free.fr> <179442432180.2199510.17732935950535223359@kernel.org>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-363623-linux-kernel-netdev=dewy.ru From: acassen@corp.free.fr (Alexandre Cassen) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 03/10] nfp: flower: refuse a tunnel key wider than the VNI Date: Sun, 15 Nov 2026 10:06:02 +0100 Organization: Usenet Network Message-ID: <3c188745-3c7e-4105-be09-60a8f9d435e9@corp.free.fr> References: <20261109131039.959438-4-acassen@corp.free.fr> <179442432180.2199510.17732935950535223359@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="1760156"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Lsf29eHnyVCv6VHuhIsCauExMq8= sha256:BSQlPbPvXUM3t3nkYnznsdTV/L0sShLbQD3RPX33tkc= sha1:6MD2XNUNXO0FaCcW+6Yi1Qo4pbU= sha256:Rl/Q5NLOFS8qF3y+t6mhY2hMty9mi5hG+8HUk/p7ou8= 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 D7AE811497F; Sun, 15 Nov 2026 12:06:42 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, 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 JlntcjbNhEt3; Sun, 15 Nov 2026 12:06:39 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-363623-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 7E10D11497E; Sun, 15 Nov 2026 12:06:30 +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 4B5913D6CC; Sun, 15 Nov 2026 09:06:15 +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=1794733573; b=OPlEDOO0Q0W2sDy0ROLNpjEWiSKcjhAiRpXrc+576j4i968L99PwWGt8yD3pX4nmB19G 13Ayje7Brzu5ROWZ5v8/FD3sxCqM5rXHl+jAS1l7SKkQOHIsHqFoIm4FBHZ4XbocJ7J6g tV3pxYAX5+RtSUNk9JJTFjf4+Z2oB3jL83V2dIQKQ7uE6CeAQCla+FH8llpfIusWuUylo NiV0+gKa3nH6IWO/KgvJ24LykVWdkSnOacNGqRKVK1O4JIjsxTQqk8dwWtafp+vJP2mak EwlWBL88mF3bDxJ0VO6QohngEjqP8IAhsN5vpn6xNvlTpReACMINZVc+B3rf7K/S2/w== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794733573; 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=ACgMyAp+PVuoyaP7vV3K9eaa7uolKbG2QsFYyIeRFH8=; b=2JsNDrHCFFAnezWhWRYlpVmBy96h8gSVWtvTt33SLwyZcc81A9pb7aM3kcbb0BuWHLo3 OsUdAOZRgPGLO1idEC6eJ8IS/dCz4ggnQaydOW9GepxnwnBrOrcdpVZd2MQ1IamkZxVhg 8s3mw2FWGhsMoeqBNC0UJUZlSOx6ZO4dKbzrfXkdg7YkFX1YdBn5/Hte9UgtCb/LocRCp 3pgGYJrCASknC2Uh+Rv8s7RtUO3KMgpylN2s/tDq+fdOWmx9yQ+Re+t9IDH57zOG4pU5p bk+a1cm0Va6omD//llnFacb+7f2/+t7LhV/Ng0MLfyKjyjf4T9VhdKkD1nhD3MeUxdg== 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=hqS4o0fy; 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 0D869606A32E; Sun, 15 Nov 2026 09:06:13 +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=hqS4o0fy 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=1794733567; b=eZhe5fKn2zK/GwVVIaCmaIQD9ASAKAjmNiV/phW4X0pWuu2mMZmglOuPFawjhcQNva3O Fr7zd3SPXPhyAl8xyysh91/ZzyAbSrzdQGptsRFCr78u1deDkzhV4j8YOmuzUqZqkIdJ3 OHDZZ5todVBzHRRv787PHwFRpMFHVfNhCzoWxTH4EOVj1MqjTwco1/FBU5V3gXk7zzWZ5 4j8FqNI2583XRbXbU/Bc03xq6LoDBXCfRgFFvXanGcX0ZyD3NknNQ691FEVWrInTSRMEX yh3rZWDHnHQlXs8TmiDet/gw/qgGQ8VXVyMHZ7/Irm8YpOJ78EnRMvoLNeDlWVsoYKA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794733567; 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=ACgMyAp+PVuoyaP7vV3K9eaa7uolKbG2QsFYyIeRFH8=; b=zKhOlLojYzosS/7anXSIvX159nFtZxn4+Zh+qMWGClpNPuFDPiZW2MX21YgosBIh3qo+ Rq3UdLG7c12GtDUG6FGU1KysqeOZJ1+wRRpnYxr7RcUcyMhsc5l+jFYegWY/45jNVSzu5 vddq6VG9KAYyZq2ECvAVwc9h/Re6jtHNC9Q+wF0PNrNSU4r09OE33UMejIVlXY3+MNCrt A017KMeU10QtULgDQO4hRXfwfDKFs3WQQWPkPGZJCea6orRLwBuVzOTMAXghLKXYo1dDS hBQ2gLuTQ8W+EhsasGcK2wInWhf8upVWiwYjlUC91K+nwytQpisv/50ZPmTBYv3X9dQ== 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=hqS4o0fy; 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)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EABE606A31A; Sun, 15 Nov 2026 09:06:06 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8EABE606A31A 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=1794733564; bh=imesrF7DpucA94oI4NcLSjSMEoFs1fSO+z/B8tR2Jh0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=hqS4o0fyma/0I0FJO991ng2V9zwNR4GujN2O6PsXv94veBGFkY9t1VPVsmb52WMEI w/zzgtmzm1Ju+b6refDVK2dHhSWTDBDeOBIxZsXcAAUp/AsTbCHd07YBZPnSliFOux BOS/swYihouO94j0ZxL4Q1oE4UYpAiBrxcAD1Jd0BHM4WbEa7ElMaQYCiT3LfZE/TZ x+m8gqWpVqem5pSd72lB6rokJyYynGB4P5WMqEyLsa7gJ+rOEOrrRT5gGxhHrgEmTA S5tZSLENmBQVOsWRwel/Zrz4pUpSi/vZJZkMrEC4V2Gqi1WqkiTbGlKTUHTEKK+fUY k+g6zBC/d9o0Q== X-Received: from [0.0.0.0] (unknown [213.228.1.188]) by rcs.proxad.net (Postfix) with ESMTPSA id A81C544C0933; Sun, 15 Nov 2026 10:06:02 +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: <179442432180.2199510.17732935950535223359@kernel.org>