aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/user_namespace.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index 5c16f3aa757a..e134d8f365dd 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -613,10 +613,10 @@ static ssize_t map_write(struct file *file, const char __user *buf,
613 if (map->nr_extents != 0) 613 if (map->nr_extents != 0)
614 goto out; 614 goto out;
615 615
616 /* Require the appropriate privilege CAP_SETUID or CAP_SETGID 616 /*
617 * over the user namespace in order to set the id mapping. 617 * Adjusting namespace settings requires capabilities on the target.
618 */ 618 */
619 if (cap_valid(cap_setid) && !ns_capable(ns, cap_setid)) 619 if (cap_valid(cap_setid) && !file_ns_capable(file, ns, CAP_SYS_ADMIN))
620 goto out; 620 goto out;
621 621
622 /* Get a buffer */ 622 /* Get a buffer */