Skip to content

Commit b9a3db9

Browse files
adrianreberChristian Brauner
authored andcommitted
pid_namespace: use checkpoint_restore_ns_capable() for ns_last_pid
Use the newly introduced capability CAP_CHECKPOINT_RESTORE to allow writing to ns_last_pid. 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 1caef81 commit b9a3db9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/pid_namespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ static int pid_ns_ctl_handler(struct ctl_table *table, int write,
269269
struct ctl_table tmp = *table;
270270
int ret, next;
271271

272-
if (write && !ns_capable(pid_ns->user_ns, CAP_SYS_ADMIN))
272+
if (write && !checkpoint_restore_ns_capable(pid_ns->user_ns))
273273
return -EPERM;
274274

275275
/*

0 commit comments

Comments
 (0)