selftests/empty_mntns: fix unknown_flags_rejected using a valid clone3 flag
Subsystems (2)
PATCH 1/1 selftests/empty_mntns: fix unknown_flags_rejected using a valid clone3 flag
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")
Signed-off-by Nathan Gao <[email protected]>
--- .../selftests/filesystems/empty_mntns/clone3_empty_mntns_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/filesystems/empty_mntns/clone3_empty_mntns_test.c +1 -1
@@ -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
Signature · 1 line
2.50.1