From: Nathan Gao <zcgao@amazon.com>
To: Shuah Khan <shuah@kernel.org>, Christian Brauner <brauner@kernel.org>
Cc: <linux-kselftest@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
"Nathan Gao" <zcgao@amazon.com>, <stable@vger.kernel.org>
Subject: [PATCH] selftests/empty_mntns: fix unknown_flags_rejected using a valid clone3 flag
Date: Wed, 16 Sep 2026 16:15:17 -0700 [thread overview]
Message-ID: <20260916231517.26147-1-zcgao@amazon.com> (raw)
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
reply other threads:[~2026-09-16 23:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260916231517.26147-1-zcgao@amazon.com \
--to=zcgao@amazon.com \
--cc=brauner@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®