🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #10002

Re: [PATCH net v2 4/4] selftests: tc-testing: teql: reject attach from another netns

#10002
From: netdev-bot+sashiko
Date: Tue, 03 Nov 2026 00:40
99 lines
11372 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] Test 124e ("Try to add teql as a child qdisc",
  tools/testing/selftests/tc-testing/tc-tests/qdiscs/teql.json) no…

--

selftests: tc-testing: teql: reject attach from another netns

This commit adds tdc case 6a06 to teql.json. The case attaches a root
teql0 qdisc from the nsPlugin test namespace and expects the attach to
be refused, because the teql0 master is registered in init_net.

> diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/teql.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/teql.json
> index 0179c57104adb..3df315629d2fc 100644
> --- a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/teql.json
> +++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/teql.json
> @@ -106,5 +106,32 @@
>          "teardown": [
>              "$TC qdisc del dev $DUMMY root handle 1:"
>          ]
> +    },
> +    {
> +        "id": "6a06",
> +        "name": "Reject TEQL attach from a different network namespace",
> +        "category": [
> +            "qdisc",
> +            "teql"
> +        ],
> +        "plugins": {
> +            "requires": [
> +                "nsPlugin"
> +            ]
> +        },
> +        "setup": [],
> +        "cmdUnderTest": "$TC qdisc add dev $DUMMY root handle 3: teql0",
> +        "expExitCode": "2",

[Severity: Medium]
This case isolates the namespace check. Is the root-only check in
teql_qdisc_init() still tested on its own anywhere?

The commit message says:

    Without a case of its own, a later reordering can make the
    namespace check answer 124e and leave the root check untested.

Case 124e ("Try to add teql as a child qdisc") also requires nsPlugin.
_ipr2_ns_create_cmds() in nsPlugin.py moves $DUMMY into the test netns:

    cmds.append(self._replace_keywords('link set $DUMMY netns {}'.format(ns)))

So the child attach in 124e:

    "cmdUnderTest": "$TC qdisc add dev $DUMMY parent 1:1 handle 2:1 teql0",
    "expExitCode": "2",

fails both of these checks in net/sched/sch_teql.c:teql_qdisc_init(),
and both return the same errno:

    if (sch->parent != TC_H_ROOT) {
        NL_SET_ERR_MSG_MOD(extack, "teql can only be used as root");
        return -EOPNOTSUPP;
    }

    if (dev_net(dev) != dev_net(m->dev)) {
        NL_SET_ERR_MSG_MOD(extack, "teql master is in a different network namespace");
        return -EOPNOTSUPP;
    }

If the sch->parent != TC_H_ROOT check were removed or broken, the netns
check would still refuse 124e's attach. tc would still exit 2,
matchJSON would still be empty, and 124e would still pass.

After this patch, does any case in teql.json fail if the root-only
check is removed?

One option is a child-attach case that does not use nsPlugin and
creates $DUMMY in init_net, the way 84a0 and 7734 do. Then only the
root check could refuse the attach.

> +        "verifyCmd": "$TC qdisc show dev $DUMMY",
> +        "matchPattern": "qdisc teql0 3: root",
> +        "matchCount": "0",

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/SER-NSBD.v2.r0.20261101171325%40mojatatu.com
Technical Details
Message-ID: <179366641986.488856.2193313144081673076@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355135-linux-kernel-netdev=dewy.ru
References: <SER-NSBD.v2.r0.20261101171325-4@mojatatu.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-355135-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2 4/4] selftests: tc-testing: teql: reject attach
 from another netns
Date: Tue, 03 Nov 2026 00:40:19 +0000
Organization: Usenet Network
Message-ID: <179366641986.488856.2193313144081673076@kernel.org>
References: <SER-NSBD.v2.r0.20261101171325-4@mojatatu.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3065839"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:qj0E54Vjq3bRuD1M14VFAmlC+y4= sha256:Ru466/7HVdcdd1qfbGtNz2cWCgRK15bBnDRUYIhSZB0=
	sha1:2mFUBg8FAUWPtMkLQckYC2SDLk8= sha256:0BnCxwboGksHcg1lS+VOVvKIgQ+TUHCf7+tZEqARM8Q=
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 EEAA91126EA; Tue,  3 Nov 2026 03:40:45 +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 8XwqRIbGHxyH;
	Tue,  3 Nov 2026 03:40:42 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-355135-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 8717F1126E4; Tue,  3 Nov 2026 03:40:34 +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 F15D8297AA; Tue,  3 Nov 2026 00:40:32 +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=1793666427;
	b=P8p4UjGqDxN34V0DfxnoAqTJHUXrj5RjHEiuHJBZA6O7lImNIfq/f/TR0ojfyNZaTsVp
	 j0G8//+75srnFlnxwvpFdWOGEYF7zkXdBl9OTXEK4wSLXs7IW4n2vCBNsdxfxnPuIj3Gx
	 XWtaWx8pkt0aGzXwU5SlW/INavg52TQlnr2fU/CdqkTutmbkAuNqeKUvTbGu5t9rQLqdj
	 J4GgOAlbGZxVQIkGrdDkjvYFoA3rlNN8Z0Mt8Bo2XnGbfCNK37ZK5OIp2ZyzDPkAsnKz0
	 m7ug16MdAkfXhVT9v7Dgr/zVPZQ78sMj9YS0jFr/zzK43bIOVtcVNRUs9RcdYX7v2iw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793666427;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=v0aMFs+uYU1dRRWuw0ENsVLlEhciR4yXakm5065aNlE=;
	b=FV7cuy7iH8seNkL1p3UFstA/UP/smP4TdXiRaETc1uatHpl5ZeVKmlETDbUyTwdBC6Hq
	 t31v65dbC+qv7zXO3vdS0vPvEMjq8YJPjuUTNkLhumari2xXhL6yupOLaqz2Up1+NeHOE
	 Qt+U61sNLyEPa9n4zpKI5Zr0KjjCoZFsXCI+v6h39bbemT5LTdmhLDCQCmdFy5gHXfSwu
	 scKmNBNJ2/dZMx+aOhXUFSs4RS8USGwGJX/g4vmNRlV3QgKiXiGdZbi1MJMJTxHcIjJ1B
	 PFYzorQwq3lyqR0LMiQimXwfkJTfGu55CjMSp4A6U4osPzv2DcWBPIwp4kO/OL8p8yQ==
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=a7J2EXsy;
	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 834CA606A330;
	Tue,  3 Nov 2026 00:40:27 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=a7J2EXsy
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=1793666421;
	b=XZ2pT4j1sKxQMn0wiSwpzNw/fFXuGZ2GRdta+2WilQfiCliKZGTrIDcriwPc1nPhePka
	 3K3z0gKEez8c+AfWbBw6F+x6H8ZknXXu+Bmo6oMHhnIOKsfLWLyo0aumLQKoMDcU+rLkd
	 99zAzaV/CfgwlpydYjrsKSKPviI5kA7Bsrhwx2as3hl4d2si5lg3wWE6WEUTZawM4of08
	 VQNNZLui0EoTYUTqukUFJ2VFizzx0Q9NyI3YjkUUQEdImc6U0BFiuBql/fjJ41TMfLZk8
	 cXfyPFJCF8fD84MaEpaBlQQLeiIXYsANCpMmXJa1xoBJ0p8pJh7T7JpzChg3EWr9qfA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793666421;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=v0aMFs+uYU1dRRWuw0ENsVLlEhciR4yXakm5065aNlE=;
	b=j3EV4gCMyrgqC9IaYMekxvNuMLHzgZVAbBxZzE3ZKa2tjLelDvJ6au27HMt25hjfnNNo
	 xQh6RiogX5Kc5KVcUZQXmuP6z+44Y3MHvrfG9D9wnPDiGAUQ0+RzMhQRWAT0s/tnoc0IC
	 P+G3JIomfLXrDWP+L6Baj2NsdARH7Y9XcEOlA040fY+TgSpBIQfv1SM2jn6nzzGotqHxM
	 3uExqGSc/FuUi2gjQMiul/h/drX9rvaULqmHQ9imBOtXqOmmk8MuAUfxWh+8A5vGz0DCw
	 PIwGuO8boSbSgeu9xTemJL2WJusxIjexNTYQVBJHtEudJ/lo/1fFrlgPna9MH92++zA==
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=a7J2EXsy;
	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 5FEAE606A329;
	Tue,  3 Nov 2026 00:40:21 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A7C11F00919;
	Tue,  3 Nov 2026 00:40:20 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1793666420;
	bh=v0aMFs+uYU1dRRWuw0ENsVLlEhciR4yXakm5065aNlE=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=a7J2EXsyHnLmsHC32GrrO6wqnRvmIaD6BL0hS4RJeDO3KpRBh9UhCOOTv867gu/m3
	 d9O2p8n7Ojm8f1G3EELGOI97igfQTEbNQGGQ8j9NIGJ5i+8hjwsBM1hTCSJbyLElz8
	 mif455ZY+9+VUJJSfUh7sr5kvAwLibA7ES1euNqE0xjX27FkuHoRDnayAHYPx35ntz
	 p0piMOIRceyWYSnd8sMFUIxQmjPg8SCIvKaOt1Jxnj5iUEUoFgmGZ2CEtn7HadW+8O
	 nZ93PBS4BC+WOGhwsJ72ODyasaNmxqdrfXuQ3/3b+SHtFs8SufaxzyVI4x4lcZ72dh
	 uuHHfpwPNCpWw==
X-Cc: netdev@vger.kernel.org, stable@vger.kernel.org, shawnq1@163.com,
 davem@davemloft.net, edumazet@kernel.org, horms@kernel.org, jiri@resnulli.us,
 kuba@kernel.org, pabeni@redhat.com, victor@mojatatu.com,
 thomas.goff@boeing.com
X-In-Reply-To: <SER-NSBD.v2.r0.20261101171325-4@mojatatu.com>
X-sashiko-severity: Medium
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