]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/pidfd: add CLONE_AUTOREAP tests
authorChristian Brauner <brauner@kernel.org>
Thu, 26 Feb 2026 13:51:02 +0000 (14:51 +0100)
committerChristian Brauner <brauner@kernel.org>
Wed, 11 Mar 2026 22:23:16 +0000 (23:23 +0100)
commit76d46ad2c52a4d7631274a35777ac4601103e2aa
tree14a7d5df9725d684b8d9ce41b48ca146d0b53de6
parentc8134b5f13ae959de2b3c8cc278e2602b0857345
selftests/pidfd: add CLONE_AUTOREAP tests

Add tests for the new CLONE_AUTOREAP clone3() flag:

- autoreap_without_pidfd: CLONE_AUTOREAP without CLONE_PIDFD works
  (fire-and-forget)
- autoreap_rejects_exit_signal: CLONE_AUTOREAP with non-zero
  exit_signal fails
- autoreap_rejects_parent: CLONE_AUTOREAP with CLONE_PARENT fails
- autoreap_rejects_thread: CLONE_AUTOREAP with CLONE_THREAD fails
- autoreap_basic: child exits, pidfd poll works, PIDFD_GET_INFO returns
  correct exit code, waitpid() returns -ECHILD
- autoreap_signaled: child killed by signal, exit info correct via pidfd
- autoreap_reparent: autoreap grandchild reparented to subreaper still
  auto-reaps
- autoreap_multithreaded: autoreap process with sub-threads auto-reaps
  after last thread exits
- autoreap_no_inherit: grandchild forked without CLONE_AUTOREAP becomes
  a regular zombie

Link: https://patch.msgid.link/20260226-work-pidfs-autoreap-v5-4-d148b984a989@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
tools/testing/selftests/pidfd/.gitignore
tools/testing/selftests/pidfd/Makefile
tools/testing/selftests/pidfd/pidfd_autoreap_test.c [new file with mode: 0644]