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: [email protected]
Signed-off-by: Nathan Gao <[email protected]>
---
.../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