mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] selftests/empty_mntns: fix unknown_flags_rejected using a valid clone3 flag
@ 2026-09-16 23:15 Nathan Gao
  0 siblings, 0 replies; only message in thread
From: Nathan Gao @ 2026-09-16 23:15 UTC (permalink / raw)
  To: Shuah Khan, Christian Brauner
  Cc: linux-kselftest, linux-kernel, Nathan Gao, stable

unknown_flags_rejected passes a supposedly unknown flag to clone3() and
expects EINVAL.  The flag it uses, 0x800000000ULL, is bit 35, which is
CLONE_NNP.  CLONE_NNP was added in commit 24baca56fafc ("clone: add
CLONE_NNP"), which got merged about the same time as this test, so the
bit was still unused when the test was written.  The clone3() call now
succeeds and the test fails.

Use bit 63 instead.  The topmost bit is the last one that can be
allocated, unlike any low unused bit which can more easily become valid
silently.

Fixes: 5b8ffd63fbd9 ("selftests/filesystems: add clone3 tests for empty mount namespaces")
Cc: stable@vger.kernel.org
Signed-off-by: Nathan Gao <zcgao@amazon.com>
---
 .../selftests/filesystems/empty_mntns/clone3_empty_mntns_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/filesystems/empty_mntns/clone3_empty_mntns_test.c b/tools/testing/selftests/filesystems/empty_mntns/clone3_empty_mntns_test.c
index 6370086f886df..72c20130a627f 100644
--- a/tools/testing/selftests/filesystems/empty_mntns/clone3_empty_mntns_test.c
+++ b/tools/testing/selftests/filesystems/empty_mntns/clone3_empty_mntns_test.c
@@ -869,7 +869,7 @@ TEST(unknown_flags_rejected)
 
 	if (pid == 0) {
 		struct __clone_args args = {
-			.flags		= 0x800000000ULL,
+			.flags		= (1ULL << 63),
 			.exit_signal	= SIGCHLD,
 		};
 		pid_t ret;

base-commit: 9b87fdc9af2fbfcdb5c24a64139685ef80f6573f
-- 
2.50.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-16 23:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16 23:15 [PATCH] selftests/empty_mntns: fix unknown_flags_rejected using a valid clone3 flag Nathan Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®