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 <areber@redhat.com> Signed-off-by: Nicolas Viennot <Nicolas.Viennot@twosigma.com> Reviewed-by: Serge Hallyn <serge@hallyn.com> Acked-by: Christian Brauner <christian.brauner@ubuntu.com> Link: https://lore.kernel.org/r/20200719100418.2112740-3-areber@redhat.com Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
1 parent 124ea65 commit 1caef81

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎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)