* [PATCH] selftests/clone3: tighten CLONE_CLEAR_SIGHAND conflict test
@ 2026-09-02 17:49 Paul Dolan
2026-09-04 7:50 ` Christian Brauner
0 siblings, 1 reply; 2+ messages in thread
From: Paul Dolan @ 2026-09-02 17:49 UTC (permalink / raw)
To: Christian Brauner, Shuah Khan; +Cc: linux-kernel, linux-kselftest
The CLONE_CLEAR_SIGHAND test intends to verify that
CLONE_CLEAR_SIGHAND and CLONE_SIGHAND are mutually exclusive. However,
CLONE_SIGHAND without CLONE_VM is independently invalid, so the test
input has another reason to fail with EINVAL.
Add CLONE_VM so that CLONE_SIGHAND is otherwise valid, and require
clone3() to fail with EINVAL. This ensures the test exercises the
intended flag conflict and does not accept an unrelated failure.
Fixes: de5287235631 ("tests: test CLONE_CLEAR_SIGHAND")
Signed-off-by: Paul Dolan <paul.dolan.dev@gmail.com>
---
tools/testing/selftests/clone3/clone3_clear_sighand.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/clone3/clone3_clear_sighand.c b/tools/testing/selftests/clone3/clone3_clear_sighand.c
index de0c9d62015d..0ad62b80ada2 100644
--- a/tools/testing/selftests/clone3/clone3_clear_sighand.c
+++ b/tools/testing/selftests/clone3/clone3_clear_sighand.c
@@ -50,12 +50,12 @@ static void test_clone3_clear_sighand(void)
* Check that CLONE_CLEAR_SIGHAND and CLONE_SIGHAND are mutually
* exclusive.
*/
- args.flags |= CLONE_CLEAR_SIGHAND | CLONE_SIGHAND;
+ args.flags |= CLONE_VM | CLONE_CLEAR_SIGHAND | CLONE_SIGHAND;
args.exit_signal = SIGCHLD;
pid = sys_clone3(&args, sizeof(args));
- if (pid > 0)
+ if (pid != -1 || errno != EINVAL)
ksft_exit_fail_msg(
- "clone3(CLONE_CLEAR_SIGHAND | CLONE_SIGHAND) succeeded\n");
+ "clone3(CLONE_CLEAR_SIGHAND | CLONE_SIGHAND) did not fail with EINVAL\n");
act.sa_handler = nop_handler;
ret = sigemptyset(&act.sa_mask);
--
2.55.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] selftests/clone3: tighten CLONE_CLEAR_SIGHAND conflict test
2026-09-02 17:49 [PATCH] selftests/clone3: tighten CLONE_CLEAR_SIGHAND conflict test Paul Dolan
@ 2026-09-04 7:50 ` Christian Brauner
0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2026-09-04 7:50 UTC (permalink / raw)
To: Shuah Khan, Paul Dolan; +Cc: linux-kernel, linux-kselftest
On Wed, 02 Sep 2026 18:49:39 +0100, Paul Dolan wrote:
> The CLONE_CLEAR_SIGHAND test intends to verify that
> CLONE_CLEAR_SIGHAND and CLONE_SIGHAND are mutually exclusive. However,
> CLONE_SIGHAND without CLONE_VM is independently invalid, so the test
> input has another reason to fail with EINVAL.
>
> Add CLONE_VM so that CLONE_SIGHAND is otherwise valid, and require
> clone3() to fail with EINVAL. This ensures the test exercises the
> intended flag conflict and does not accept an unrelated failure.
>
> [...]
Applied to the vfs-7.4.misc branch of the vfs/vfs.git tree.
Patches in the vfs-7.4.misc branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.4.misc
[1/1] selftests/clone3: tighten CLONE_CLEAR_SIGHAND conflict test
https://git.kernel.org/vfs/vfs/c/aeebb4884f0e
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-04 7:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-02 17:49 [PATCH] selftests/clone3: tighten CLONE_CLEAR_SIGHAND conflict test Paul Dolan
2026-09-04 7:50 ` Christian Brauner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox