aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/user_namespace.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index 6e80f4c1322b..a2e37c5d2f63 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -826,6 +826,11 @@ static bool new_idmap_permitted(const struct file *file,
826 kuid_t uid = make_kuid(ns->parent, id); 826 kuid_t uid = make_kuid(ns->parent, id);
827 if (uid_eq(uid, cred->euid)) 827 if (uid_eq(uid, cred->euid))
828 return true; 828 return true;
829 } else if (cap_setid == CAP_SETGID) {
830 kgid_t gid = make_kgid(ns->parent, id);
831 if (!(ns->flags & USERNS_SETGROUPS_ALLOWED) &&
832 gid_eq(gid, cred->egid))
833 return true;
829 } 834 }
830 } 835 }
831 836