aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Reber <[email protected]>2020-07-19 12:04:13 +0200
committerChristian Brauner <[email protected]>2020-07-19 20:14:42 +0200
commitb9a3db92e1a1f281724e2f34b849d18d1a53bece (patch)
treef2ac0fe3487dd9abf8100add478736f2800a04fc
parent1caef81da05a84a40dbf02110e967ce6d1135ff6 (diff)
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]>
-rw-r--r--kernel/pid_namespace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index 0e5ac162c3a8..ac135bd600eb 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -269,7 +269,7 @@ static int pid_ns_ctl_handler(struct ctl_table *table, int write,
struct ctl_table tmp = *table;
int ret, next;
- if (write && !ns_capable(pid_ns->user_ns, CAP_SYS_ADMIN))
+ if (write && !checkpoint_restore_ns_capable(pid_ns->user_ns))
return -EPERM;
/*