mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 15:03:52 +08: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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user