Skip to content

Commit 1caef81

Browse files
adrianreberChristian Brauner
authored andcommitted
pid: use checkpoint_restore_ns_capable() for set_tid
Use the newly introduced capability CAP_CHECKPOINT_RESTORE to allow using clone3() with set_tid set. Signed-off-by: Adrian Reber <[email protected]> Signed-off-by: Nicolas Viennot <[email protected]> Reviewed-by: Serge Hallyn <[email protected]> Acked-by: Christian Brauner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 124ea65 commit 1caef81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/pid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ struct pid *alloc_pid(struct pid_namespace *ns, pid_t *set_tid,
198198
if (tid != 1 && !tmp->child_reaper)
199199
goto out_free;
200200
retval = -EPERM;
201-
if (!ns_capable(tmp->user_ns, CAP_SYS_ADMIN))
201+
if (!checkpoint_restore_ns_capable(tmp->user_ns))
202202
goto out_free;
203203
set_tid_size--;
204204
}

0 commit comments

Comments
 (0)