Article View: linux.kernel.netdev
Article #20513Re: [PATCH net-next v2 07/10] selftests: forwarding: tc_flower: test the enc_key_id mask
From: Alexandre Cassen
Date: Sun, 22 Nov 2026 20:33
Date: Sun, 22 Nov 2026 20:33
83 lines
11738 bytes
11738 bytes
On 11/20/26 04:30, netdev-bot+sashiko@kernel.org wrote:
> [Severity: Low]
> Which iproute2 change adds the MASKED-KEY-ID token to the flower help
> output?
>
> The kernel tree does not contain MASKED-KEY-ID. It also does not contain
> the "enc_key_id 256/0xf00" dump format checked further down. Released tc
> parses enc_key_id as a plain be32 and rejects 256/0xf00. The commit
> message does not name or link the tc patch that these strings come from.
>
> With any tc that lacks this exact token, the test echoes the SKIP line
> and returns 0 without a TEST: line. The new TCA_FLOWER_KEY_ENC_KEY_ID_MASK
> handling in fl_set_key() and fl_dump_key() is then never exercised.
>
> If the final tc patch uses a different help placeholder, the test would
> skip forever. If tc prints the key in another format, the dump check
> would fail.
>
> Could the commit reference the tc change it depends on? Then the probe
> string and the dump format could be checked against it.
The tc side is the iproute2 pair posted with v1 [1]. v3 drops the help
probe.
The test now adds a probe filter and reads its mask back. That also checks
the dump format of the pair.
> [Severity: Medium]
> What happens here when a tc that knows the mask runs on a kernel without
> TCA_FLOWER_KEY_ENC_KEY_ID_MASK?
>
> tc answers the flower help probe above by itself and never asks the
> kernel. So the probe only detects userspace support.
>
> TCA_FLOWER_KEY_ENC_KEY_ID_MASK is added just before __TCA_FLOWER_MAX, so
> older kernels have a smaller TCA_FLOWER_MAX. fl_change() parses the
> options liberally:
>
> net/sched/cls_flower.c:fl_change() {
> ...
> err = nla_parse_nested_deprecated(tb, TCA_FLOWER_MAX,
> tca_opts, fl_policy, NULL);
> ...
> }
>
> In that mode, __nla_validate_parse() skips attributes above maxtype:
>
> lib/nlattr.c:__nla_validate_parse() {
> ...
> if (type == 0 || type > maxtype) {
> if (validate & NL_VALIDATE_MAXTYPE) {
> ...
> return -EINVAL;
> }
> continue;
> }
> ...
> }
>
> So an older kernel would install the enc_key_id 256/0xf00 filter as an
> exact match on key 256. The "Did not dump the mask" and "Did not match a
> key inside the mask" checks would both fail, and tc_flower.sh would exit
> with ksft_fail.
>
> Documentation/dev-tools/kselftest.rst says mainline kselftests should
> skip gracefully on older stable kernels. The test already reads the dump
> back. Could a missing mask in the dump be handled the same way as the tc
> probe, instead of being reported as a failure?
Yes. On a kernel without the mask the v2 test fails with "Did not dump
the mask".
In v3 the probe filter goes on $h2 first. When its dump lacks the mask,
the test
logs a SKIP line and returns. It now passes on a kernel with the mask
and only
logs the skip on a kernel without it, with the new and the old tc alike.
[1]
https://lore.kernel.org/netdev/20261109131151.960789-1-acassen@corp.free.fr/
Technical Details
Message-ID:
<73a9b976-ad73-4793-8444-bcbbf7b2bd8f@corp.free.fr>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368811-linux-kernel-netdev=dewy.ruReferences:
<20261117092915.255194-8-acassen@corp.free.fr> <179514544037.3136.16339086532983375306@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-368811-linux-kernel-netdev=dewy.ru From: acassen@corp.free.fr (Alexandre Cassen) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v2 07/10] selftests: forwarding: tc_flower: test the enc_key_id mask Date: Sun, 22 Nov 2026 21:33:49 +0100 Organization: Usenet Network Message-ID: <73a9b976-ad73-4793-8444-bcbbf7b2bd8f@corp.free.fr> References: <20261117092915.255194-8-acassen@corp.free.fr> <179514544037.3136.16339086532983375306@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="3718232"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:QTbm7s+wrOHXCVn2Zp0tZQcU5dc= sha256:5BblobMIzZHMNAjoFm9Y/ZfSaOqYkGKJEzhCwGkWi2Q= sha1:U3Z2z8dA73QEVRA+uPXLdsbvXkg= sha256:MJFzEiPq+D6bMjtNUiFBAhUERzD88nZeCPhTdlWCFj0= 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 DB9B2125D7A; Sun, 22 Nov 2026 23:34:13 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 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, URIBL_BLOCKED=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 utldMqRsY8hI; Sun, 22 Nov 2026 23:34:05 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-368811-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 4CEFD125D82; Sun, 22 Nov 2026 23:33:57 +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 A2C1F2C4C0; Sun, 22 Nov 2026 20:33:55 +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=1795379635; b=dC1GU8m4d4D6v4uWimqPZwQmFEZ/5/lgyb74S31RBUI/aphE7iJDdriuNrHNFewkxOHk OgavSE2LkRa5XC00K4g8lg3A52gB6Mgf3mu9MajeEfje7uZkLpplIi/VZA+mwtWn6gR4O IdEUx+M06mIPN8bdq3VMP4FrtycYjM2o9Zu5ir8c1Wkcv9c8aGJZwiZXw8hMOj/ly7vue cRacR1BzGbh4e+Y30NyVPRLN06ACC2nO66jTdhfQWNFUD0QQXTVY/kGST4JYrtnuAIrdZ GGy0CuDcu7UxwnBtAQlty04SlcJtjEJfkMgJAUX5Ft810V1PXfUzGoOZ7PdhmeP7KSQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795379635; 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=RA8x73YPrFGxdZjoHXQbPrziSX/WOKdJXB926WeBtQY=; b=o5AECGguxr4Df9PIM+mEnV2oE26Iu/KHvQnt714cFJaudYUvO2B1H5RL4ATRein6DBHp iOMOJGFJcSrXB1vf9kYUyqw1N+Akf/aNkxqwmz1rb0z4knf1q+v2jCY3CYoJ+VRblr+0a f6ZqigQ6lIvmjg8HXZtrWWGSqw5ec/S229sHFKMrSY/fBLaBCyC0hIus5oX31sbFgpaxt QocNztmsb/TG86JgLZcggtctyxjsJMOxFCrHvdVHXYpJbkNqVLhvXSDi07/dazKI/dAW1 z2zITFHZJh0IzYUNx8pJXjt69LKtTMlSyU9JjcBKojx9QMVDTXnLJvm+qQrTUS2mf5g== 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=XhHbwF8m; 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 36E72606A332; Sun, 22 Nov 2026 20:33:55 +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=XhHbwF8m 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=1795379634; b=2xuW3YOcGKpEAWq2U7oxYv2+DVjteYMgPf14RnYc8jmmOdM5tQfeJHiFW+nH/LIQKZey MjrUpX/vCGg18+oDCheAUuaueH3RKXKfEghgGF7PVEdcwFkl2XqDJH+ZLbPqOFJk4mFqU 95ZNrmD1xLIqnvZ2bsqSkITzjhY+xUBJB/a6+2vibYJlCUzKUTXrfP6FpJ67G4yZdtAvI U1pssGswD/tS51Rl+PeEjp2Sx80lI3QLYxo3l9Iln38a0f5UWcsWzSRu3LbJQqc6evOGm 2XaqeT28VbDPAbkckQ+ZU4bYIdk6PZbJE/+kjQkqPjse1JqHwwnmbDwxz/Rf59gzzew== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795379634; 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=RA8x73YPrFGxdZjoHXQbPrziSX/WOKdJXB926WeBtQY=; b=rFGxGrITjgomTLFMVwRTsLb9sddQ9f/WjbBqCphuK0/aAawYHah/lVKQLQPEGhkqIVRA 8OTsRZGaRmK3p2QzPD4UzApmHvvt00Jnv6jsO445PTkonbn9XefFngfY5vJlRrvGfTfhC 6q8fEe5qTjQ5UwZD5gvS2nNzDswnXdVRCapQhTM9swNzvGPRJsTaep2b2wMWLSVnJb37K BBys7X/+paYux1wg4/oOc4v157OltojQtRynub2yPoz/y0aRD0FlJveGGe5rVaRWSf1EL V1FoZbF/UV6PWTLeVXfnMRe1oB6DrasPnndv43xR+qkaUcNhfxIMYzdEev05WR7aFug== 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=XhHbwF8m; 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 B9CE0606A31A; Sun, 22 Nov 2026 20:33:53 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B9CE0606A31A 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=1795379631; bh=1AkORMZI9fsVIs2vr6hJ9ymldCq6J3f7/QD/Oa4DfIM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=XhHbwF8mqx6NhCtA6G/mPzI2EfpUxZgJQPgfyss+ngvduypWUxSqkNwAiW6YYZoiB YL5+0QNWA/ELIooQLppESOKsb6/JXB//sno6A4YaRnChIp9WUtOiUAL+NASCPRJbXH rf0C8uCEGc9lahloB5ABzd3cXYmCm29r4LG2ZHi8cqoRrMKJX4d46mGzHLwmWkBUK+ CRw6ovrV4R9+69+fZ+9DBNmn092HQ5fl/6jOphyWz2Va7Zh14q078RpR3cJ2Ojkpjh XwBHEbYLWkqULXf5fersIUELt/B5LXdDTTeC58V+lWHJRzGnWc/81nXVxy4ONmKpW2 ul5JpZylbZyRw== X-Received: from [0.0.0.0] (unknown [213.228.1.188]) by rcs.proxad.net (Postfix) with ESMTPSA id C990644C0B3E; Sun, 22 Nov 2026 21:33:49 +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: <179514544037.3136.16339086532983375306@kernel.org>