diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2014-12-05 18:14:19 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-08 10:27:48 -0800 |
commit | 7d9436876e6e8b1f9e1e5eeb42a6081e29aadc52 (patch) | |
tree | 13a81a2914e13dae44269356ef94dac4d2a3844f | |
parent | 41f3d9fb911ed645e453b23dff3bb4fcb1190ca7 (diff) | |
download | linux-stable-7d9436876e6e8b1f9e1e5eeb42a6081e29aadc52.tar.gz linux-stable-7d9436876e6e8b1f9e1e5eeb42a6081e29aadc52.tar.bz2 linux-stable-7d9436876e6e8b1f9e1e5eeb42a6081e29aadc52.zip |
userns: Don't allow unprivileged creation of gid mappings
commit be7c6dba2332cef0677fbabb606e279ae76652c3 upstream.
As any gid mapping will allow and must allow for backwards
compatibility dropping groups don't allow any gid mappings to be
established without CAP_SETGID in the parent user namespace.
For a small class of applications this change breaks userspace
and removes useful functionality. This small class of applications
includes tools/testing/selftests/mount/unprivilged-remount-test.c
Most of the removed functionality will be added back with the addition
of a one way knob to disable setgroups. Once setgroups is disabled
setting the gid_map becomes as safe as setting the uid_map.
For more common applications that set the uid_map and the gid_map
with privilege this change will have no affect.
This is part of a fix for CVE-2014-8989.
Reviewed-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | kernel/user_namespace.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c index 27c8dab48c07..1ce6d67c07b7 100644 --- a/kernel/user_namespace.c +++ b/kernel/user_namespace.c @@ -821,10 +821,6 @@ static bool new_idmap_permitted(const struct file *file, kuid_t uid = make_kuid(ns->parent, id); if (uid_eq(uid, file->f_cred->fsuid)) return true; - } else if (cap_setid == CAP_SETGID) { - kgid_t gid = make_kgid(ns->parent, id); - if (gid_eq(gid, file->f_cred->fsgid)) - return true; } } |