Skip to content

Commit 4fc3f73

Browse files
committed
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/[email protected] Reviewed-by: Oleg Nesterov <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 8cf4b73 commit 4fc3f73

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/testing/selftests/pidfd/pidfd_info_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ TEST_F(pidfd_info, thread_group)
299299
/* Opening a thread as a thread-group leader must fail. */
300300
pidfd_thread = sys_pidfd_open(pid_thread, 0);
301301
ASSERT_LT(pidfd_thread, 0);
302+
ASSERT_EQ(errno, ENOENT);
302303

303304
/* Opening a thread as a PIDFD_THREAD must succeed. */
304305
pidfd_thread = sys_pidfd_open(pid_thread, PIDFD_THREAD);

0 commit comments

Comments
 (0)