This is a note to let you know that I've just added the patch titled
userns: Don't allow unprivileged creation of gid mappings
to the 3.17-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
userns-don-t-allow-unprivileged-creation-of-gid-mappings.patch
and it can be found in the queue-3.17 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From be7c6dba2332cef0677fbabb606e279ae76652c3 Mon Sep 17 00:00:00 2001
From: "Eric W. Biederman" <[email protected]>
Date: Fri, 5 Dec 2014 18:14:19 -0600
Subject: userns: Don't allow unprivileged creation of gid mappings
From: "Eric W. Biederman" <[email protected]>
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 <[email protected]>
Signed-off-by: "Eric W. Biederman" <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
kernel/user_namespace.c | 4 ----
1 file changed, 4 deletions(-)
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -821,10 +821,6 @@ static bool new_idmap_permitted(const st
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;
}
}
Patches currently in stable-queue which might be from [email protected] are
queue-3.17/mnt-update-unprivileged-remount-test.patch
queue-3.17/mnt-fix-a-memory-stomp-in-umount.patch
queue-3.17/userns-check-euid-no-fsuid-when-establishing-an-unprivileged-uid-mapping.patch
queue-3.17/mnt-implicitly-add-mnt_nodev-on-remount-when-it-was-implicitly-added-by-mount.patch
queue-3.17/userns-don-t-allow-unprivileged-creation-of-gid-mappings.patch
queue-3.17/userns-rename-id_map_mutex-to-userns_state_mutex.patch
queue-3.17/userns-add-a-knob-to-disable-setgroups-on-a-per-user-namespace-basis.patch
queue-3.17/userns-allow-setting-gid_maps-without-privilege-when-setgroups-is-disabled.patch
queue-3.17/userns-don-t-allow-setgroups-until-a-gid-mapping-has-been-setablished.patch
queue-3.17/groups-consolidate-the-setgroups-permission-checks.patch
queue-3.17/userns-only-allow-the-creator-of-the-userns-unprivileged-mappings.patch
queue-3.17/userns-document-what-the-invariant-required-for-safe-unprivileged-mappings.patch
queue-3.17/umount-disallow-unprivileged-mount-force.patch
queue-3.17/userns-unbreak-the-unprivileged-remount-tests.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html