mirror of
https://github.com/torvalds/linux.git
synced 2026-03-14 00:56:20 +01:00
selftest/pidfd: add test for thread-group leader pidfd open for thread
Verify that we report ENOENT when userspace tries to create a thread-group leader pidfd for a thread pidfd that isn't a thread-group leader. Link: https://lore.kernel.org/r/20250403-work-pidfd-fixes-v1-4-a123b6ed6716@kernel.org Reviewed-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
8cf4b738f6
commit
4fc3f73c16
1 changed files with 1 additions and 0 deletions
|
|
@ -299,6 +299,7 @@ TEST_F(pidfd_info, thread_group)
|
|||
/* Opening a thread as a thread-group leader must fail. */
|
||||
pidfd_thread = sys_pidfd_open(pid_thread, 0);
|
||||
ASSERT_LT(pidfd_thread, 0);
|
||||
ASSERT_EQ(errno, ENOENT);
|
||||
|
||||
/* Opening a thread as a PIDFD_THREAD must succeed. */
|
||||
pidfd_thread = sys_pidfd_open(pid_thread, PIDFD_THREAD);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue