🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #9398

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

#9398
From: Jamal Hadi Salim
Date: Mon, 02 Nov 2026 00:37
64 lines
12848 bytes
Found by Sashiko (nipa) while reviewing the previous posting of the
cross-netns rejection fix:
https://netdev-ai.bots.linux.dev/sashiko/#/patchset/SER-NSBD.v1.r2.20261031160050-3%40mojatatu.com

The issue:
Case 124e covers the root-only rejection, but nsPlugin moves the test
device into its own network namespace, so the namespace check answers it
first unless the two checks run in the other order. Nothing else covers
the namespace rejection: the teql0 master is registered in init_net, and
a root qdisc attach from the test namespace must be refused with
-EOPNOTSUPP. Without a case of its own, a later reordering can make the
namespace check answer 124e and leave the root check untested.

The Fix:
Add a case that attaches a root teql0 qdisc from the test namespace. The
attach is a root qdisc as well, so only the namespace check can refuse
it. Without the fix the attach succeeds and the master is mutated from
the foreign namespace.

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
 .../tc-testing/tc-tests/qdiscs/teql.json      | 27 +++++++++++++++++++
 1 file changed, 27 insertions(+)

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 0179c57104ad..3df315629d2f 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",
+        "verifyCmd": "$TC qdisc show dev $DUMMY",
+        "matchPattern": "qdisc teql0 3: root",
+        "matchCount": "0",
+        "teardown": [
+            [
+                "$TC qdisc del dev $DUMMY root handle 3:",
+                0,
+                1,
+                2
+            ]
+        ]
     }
 ]
-- 
2.43.0
Technical Details
Message-ID: <SER-NSBD.v2.r0.20261101171325-4@mojatatu.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354388-linux-kernel-netdev=dewy.ru
References: <SER-NSBD.v2.r0.20261101171325@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-354388-linux-kernel-netdev=dewy.ru
From: jhs@mojatatu.com (Jamal Hadi Salim)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2 4/4] selftests: tc-testing: teql: reject attach from another netns
Date: Sun,  1 Nov 2026 19:37:06 -0500
Organization: Usenet Network
Message-ID: <SER-NSBD.v2.r0.20261101171325-4@mojatatu.com>
References: <SER-NSBD.v2.r0.20261101171325@mojatatu.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2807775"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:UJFWaMjM/w65rBTjiRnwbhLZ/MU= sha256:CnpSYBf9OnwK5SeFA/x2Oxwmv7YReWrwSrRHnT7Vwxw=
	sha1:ptQABKrNyRuS1O7aI0hPFX+wulA= sha256:YcDkSv7d9ULSKjn8Nau7J6D5LsqlifvweMR0IsqVaaQ=
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 71CF61123D2; Mon,  2 Nov 2026 03:38:05 +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.25,
	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 (1024-bit key)
	header.d=mojatatu.com
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 I15XOe16A1Oo;
	Mon,  2 Nov 2026 03:38:02 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-354388-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=mojatatu.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 9C1D31123BD; Mon,  2 Nov 2026 03:37:54 +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 1C4452C026; Mon,  2 Nov 2026 00:37:22 +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=1793579841;
	b=pvC3ykE1D8eNJnq6JVGknQjrNj0FL16yeb6TbYqe0rng5NF8v6ZhLcgQhrsYDgTo3ApB
	 N6LumSF7KhkepUJnjKqk+0B76Z9vaC/kckXoWDhGbNAJwOI3FjmQZbVpa845dF0ZQJHBj
	 uM/BouaHMOgW8+uqFxTAqnnvPUtaokrNTojD03uz9TTqMhPYN2wKn0iO8h7SjqEhprvrc
	 HxE2e+hZvHroarpPTqrSN5fyyGfEUlx6H9GImXZX6tE5vlq0YoCdNBhV8mudCjoAvVd3D
	 68BTBS0fUWYIj4FC3Lj/yAA7xjzhOgXCi7hcTHlhLTcActsdSUFw80/bRXJd/C8eofw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793579841;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:
	 References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=8U2P0iAh2BG7KjvPP6wqvmh3hv9L2W1VYLUEiGNWDRM=;
	b=3SW0pifJcvhVa3Op977nLaKOQ/E1V+wfoYQwxfssXekAP5bntxShyRTlt0wcBTAMCmE+
	 yIHGDkPRxzo+iCwyEHOeku4OK555TH2i6MsYTIfFg91J0of2nAYm+uj2nnZRG1jbRRYMT
	 um/M3M0zyjwXYhOb7Uz9Xalgda04MBY9TiPhyzsbY8WweL9rGdNk57f8926A8UcXtWT9U
	 JIYeXsDZ5pHEy4n9+fzhveKwhfVfJnpiO3s6oOih799cTuTGgcfD6uRAXyfjJriUTah5D
	 gmOyjvU58uLXD7KfKXPv8XKAi84PodbQ4MJ3oIUq9slDMFD3lDIWcxRGUHhdq3onGvw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=mojatatu.com header.i=@mojatatu.com header.a=rsa-sha256 header.s=google header.b=QcWYu3dF;
	dmarc=none header.from=mojatatu.com;
	spf=none smtp.mailfrom=mojatatu.com;
	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 E4AAF606A329;
	Mon,  2 Nov 2026 00:37:20 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=mojatatu.com header.i=@mojatatu.com header.a=rsa-sha256 header.s=google header.b=QcWYu3dF
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.49
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793579840;
	b=2pqEXV2Jn107DOHvecoAvOaiDZWmouIOgSluwKiFDv4icbcCx4Fq8TUeNEkStgJia6B/
	 O9lK8BnDrcgynqINgvboXYV0xAXmlBOECRkO0G6cJaocGnviaoNupvVu2FibatydVSVHd
	 mPRb85ZoU/n6IbcVAKCeRqII+a/AXT6cV3fqJ94AfkWFEuZpt7G/YaijyV6VDg85QFn8T
	 q+Q4+YRj+3xOakHeIj4SQsuKlY82QXJahpMdZGQ081EHmaainKSgfQpq5rR/nchozt49K
	 IAsaANbYG1Zlx2SQzFejtfg0lGtDmD/Jpy2WL32vGgfzhTjmvqXdMMtx+7c49yQC0QQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793579840;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
	 Date:Message-Id:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding;
	bh=8U2P0iAh2BG7KjvPP6wqvmh3hv9L2W1VYLUEiGNWDRM=;
	b=VWvLUDRT4uTs0vL45sVaIdk6SolC89xSDfDk1IdzFvAzcJIsvbHkeeyu+4/axD5pMRhS
	 f4PeKhp/CMmKC8fGxJsx1OY+V6z/jN6REix8zH5nh7vX2vNvzipbIyMACUVPCrE/ok567
	 3dvzwdBIHOmM5QTS63W2LsKSAF6njFx2X739aHJFf705tzGRa6tUIrDbuGAb1lwChrKid
	 DqZbmJa58bY6nzx+IawQ7831bb1mvw7bfnF1lW0W+5aJrGfPft0v2IwyiVDyjY1b4kIeC
	 wPbgEglN6gEFVm+b9EObbJhlqS60tyFedkK0Zf1DpiTpqX1cPPiz5SR2GuquI9X+XDg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=mojatatu.com;
	spf=none smtp.mailfrom=mojatatu.com;
	dkim=pass header.d=mojatatu.com header.i=@mojatatu.com header.a=rsa-sha256 header.s=google header.b=QcWYu3dF;
	arc=none smtp.remote-ip=209.85.219.49
X-Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B0B6606A337
	for <netdev@vger.kernel.org>; Mon,  2 Nov 2026 00:37:19 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7B0B6606A337
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mojatatu.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=mojatatu.com
X-Received: by mail-qv1-f49.google.com with SMTP id 6a1803df08f44-91b8306b9f8so45012856d6.3
        for <netdev@vger.kernel.org>; Sun, 01 Nov 2026 16:37:19 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=mojatatu.com; s=google; t=1793579838; x=1794184638; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=8U2P0iAh2BG7KjvPP6wqvmh3hv9L2W1VYLUEiGNWDRM=;
        b=QcWYu3dF8fE5k6F25sAPvmrZihimPCxUbC4DFTVaeDf1sMJ7pYu2/tpkP8nXiDa1SB
         shV/LeeL4Y3hhZvtvFQb/YYYgk5J5HuSJOQWh22OoY47Kf/8wag8hjZsPj/eOEucflPR
         NWK6T/gRcP50O/9nH7z2lzsR+kwdrlHY+oo0o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1793579838; x=1794184638;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=8U2P0iAh2BG7KjvPP6wqvmh3hv9L2W1VYLUEiGNWDRM=;
        b=QXz4mj3HYpH5zoBJmwNLQiXOXr7oAu61pL4pQlrH/Ilp58OgZ+MYa3na+j4IiB7GDh
         8TfWJSqByU+bGkTMmRSo28GQCwjmk2Itsbo6hg2gVtoXxfb+gF/5sl4tGxSzHJDmvXbs
         WukyXLCF7ISNXymrCWC7DIPnl0HikpAuQL607Y0wVkdFGuknZ9BBp3gbGnuwlGEJjby1
         jPbpH3obZifGKDQ0KejuWuuVQR5Cw2QTgC/oJnmbmQ2fIfCKW2mCaFs4MRWTkUFuwXOm
         ZM/E8Kwck3a+tdMj9LzqXc9zFAIswUB5G9aOxtdAM1d9tTnEg3I4BgFrcVk99EILRQAa
         OKPg==
X-Gm-Message-State: APuU4Z9/CKnHbVDrMgzkugEtogecan/MAL/cUICEM7bCv8aD6jXOdHf4
	ILTBGLKMNWcqq/P9iGDIj3tsZjmRR1Hks8yLuOjzUIz3tNRbtyABUjGCf8wweZgjAbPZ62AoH8r
	IJIk=
X-Gm-Gg: AYBFou3hQSXGARPf6IOIY8RB2o/GeE46AM4xpDCKiZqnhmrOU3yFqIhrclmrz4JyoJ8
	nazNdwvKMlvuIsPCTiz3FlEzthCPC25fD1q6BeRxKvVqp1dFleo43sHGrc1GwACJkBlaFL/XqBu
	z7Bkxh2BTHvaFs9cl3sj4QE+nBfpOEolNft8lLaJ+XfGRNkFl59C6e/zTgwtXewJGw5ELro4EM9
	92zqY5r7gnXkQovHDhRR9ONhpWuGcbM6KrrL/7GxAARhuX1Diaey+23jPDRJUhN3WfPsBi3f2RK
	cAs66I13PS8Bq2lm+2ExFgPUp97seYVy/mb/Ajc6plxx3F0DBHvmuNx/F2MqM8Wj5VCj2arVM0V
	XioaXspcTluOQ6KYaArnhrY05uAawKXR43ROkHVDYhOEoQb3pD1r6wFUyYzRd+HulQ3ZKbgz7h6
	yxaz/pU6Uj+FD+0zSrvpcFeHu1mjZIAiUdkzsXvSPbyOWrHq3ca33kqGbdKeKYOErGGDYX3kiG8
	1J5iAHm7F/qm6/j1Zvt/R3bF7rOh4shz3yYNtlVA4oyo96EWnCY4CYjDpyuwclFiZXDMK6MIyYh
	y7OTIAiIggo7yqI4/OC0qXgGhFxMx6jdNxgaLHnkaJYTKbs/vPrl2ano1Kp4eiPP4k1mbQyQ3tX
	9XQbrZe1V63WSLwk=
X-Received: by 2002:a05:6214:3d0d:b0:90e:8221:f1c7 with SMTP id 6a1803df08f44-91ca49e9c82mr156416236d6.1.1793579838604;
        Sun, 01 Nov 2026 16:37:18 -0800 (PST)
X-Received: from mbili.tail33bf8.ts.net ([64.203.83.2])
        by smtp.gmail.com with ESMTPSA id 6a1803df08f44-91ca7f23754sm77043066d6.9.2026.11.01.16.37.17
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Sun, 01 Nov 2026 16:37:18 -0800 (PST)
X-Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>,
	Victor Nogueira <victor@mojatatu.com>,
	Sashiko <sashiko-bot@kernel.org>,
	Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org
X-Mailer: git-send-email 2.34.1
X-In-Reply-To: <SER-NSBD.v2.r0.20261101171325@mojatatu.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