[PATCH v3 3/4] pidfd: Use scoped cleanup for task access

sashiko-bot at kernel.org sashiko-bot at kernel.org
Sat Oct 10 10:30:49 UTC 2026


> From: Chen Linxuan <me at black-desk.cn>
> 
> Split namespace acquisition from namespace fd creation and represent a
> privileged target task as a scoped class that owns both the task
> reference and exec_update_lock. Use the class for namespace lookups so
> ptrace access checks and task state reads remain tied to the same exec
> critical section, while open_namespace() stays outside the lock.
> 
> Carry the pid namespace visibility check into the helper so that all
> users of the class enforce it.
> 
> 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=3




More information about the Linux-security-module-archive mailing list