]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
clone: add CLONE_NNP
authorChristian Brauner <brauner@kernel.org>
Thu, 26 Feb 2026 13:51:00 +0000 (14:51 +0100)
committerChristian Brauner <brauner@kernel.org>
Wed, 11 Mar 2026 22:15:15 +0000 (23:15 +0100)
commit24baca56fafc33d4fb77cd9858a48c734183cb22
tree8b819c9a038a0ef57c94547e49e525ed31959e72
parent12ae2c81b21cfaa193db2faf035d495807edc3a7
clone: add CLONE_NNP

Add a new clone3() flag CLONE_NNP that sets no_new_privs on the child
process at clone time. This is analogous to prctl(PR_SET_NO_NEW_PRIVS)
but applied at process creation rather than requiring a separate step
after the child starts running.

CLONE_NNP is rejected with CLONE_THREAD. It's conceptually a lot simpler
if the whole thread-group is forced into NNP and not have single threads
running around with NNP.

Link: https://patch.msgid.link/20260226-work-pidfs-autoreap-v5-2-d148b984a989@kernel.org
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/uapi/linux/sched.h
kernel/fork.c