[PATCH v3 4/4] pidfd: Add task path ioctls
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Sat Oct 10 10:32:49 UTC 2026
> From: Chen Linxuan <me at black-desk.cn>
>
> Add PIDFD_GET_EXE, PIDFD_GET_CWD, and PIDFD_GET_ROOT to return
> close-on-exec O_PATH file descriptors referencing the target task's
> executable, working directory, and root directory.
>
> The ioctls acquire the target through the shared task acquisition
> helper and are thus subject to the same checks as the namespace
> ioctls. The target is sampled while holding exec_update_lock so that
> the access check and the path read cannot race with execve().
>
> This allows userspace to obtain stable path references from a pidfd
> without requiring procfs.
>
> Assisted-by: LLM
> Signed-off-by: Chen Linxuan <me at black-desk.cn>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261010-pidfd-get-paths-v3-0-f245440b2b30@black-desk.cn?part=4
More information about the Linux-security-module-archive
mailing list