]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/pidfd: add CLONE_PIDFD_AUTOKILL tests
authorChristian Brauner <brauner@kernel.org>
Thu, 26 Feb 2026 13:51:04 +0000 (14:51 +0100)
committerChristian Brauner <brauner@kernel.org>
Wed, 11 Mar 2026 22:23:46 +0000 (23:23 +0100)
commitec26879e6d89983b31fdb27d149854f42ee8d689
tree2b7fd1e08c4e2a055203a2921f2c7a2348a3ffbb
parent2a4d85aa1c0a894d962a15dc75e8489f1e91f5f6
selftests/pidfd: add CLONE_PIDFD_AUTOKILL tests

Add tests for CLONE_PIDFD_AUTOKILL:

- autokill_basic: Verify closing the clone3 pidfd kills the child.
- autokill_requires_pidfd: Verify AUTOKILL without CLONE_PIDFD fails.
- autokill_requires_autoreap: Verify AUTOKILL without CLONE_AUTOREAP
  fails.
- autokill_rejects_thread: Verify AUTOKILL with CLONE_THREAD fails.
- autokill_pidfd_open_no_effect: Verify only the clone3 pidfd triggers
  autokill, not pidfd_open().
- autokill_requires_cap_sys_admin: Verify AUTOKILL without CLONE_NNP
  fails with -EPERM for an unprivileged caller.
- autokill_without_nnp_with_cap: Verify AUTOKILL without CLONE_NNP
  succeeds with CAP_SYS_ADMIN.

Link: https://patch.msgid.link/20260226-work-pidfs-autoreap-v5-6-d148b984a989@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
tools/testing/selftests/pidfd/pidfd_autoreap_test.c