Bugzilla – Bug 809296
VUL-1: CVE-2013-1858: kernel: local privilege escalation using CLONE_NEWUSER
Last modified: 2013-07-17 13:00:56 UTC
is public, via Sebastian Krahmer
From: Sebastian Krahmer <firstname.lastname@example.org>
Date: Wed, 13 Mar 2013 16:39:56 +0100
Subject: [oss-security] CLONE_NEWUSER|CLONE_FS root exploit
Seems like CLONE_NEWUSER|CLONE_FS might be a forbidden
During evaluating the new user namespace thingie, it turned out
that its trivially exploitable to get a (real) uid 0,
as demonstrated here:
The trick is to setup a chroot in your CLONE_NEWUSER,
but also affecting the parent, which is running
in the init_user_ns, but with the chroot shared.
Then its trivial to get a rootshell from that.
Tested on a openSUSE12.1 with a custom build 3.8.2 (x86_64).
I hope I didnt make anything wrong, mixing up the UIDs,
or disabled important checks during kernel build on my test
fixed by upstream commit e66eded8309ebf679d3d3c1f5820d1f2ca332c71
author Eric W. Biederman <email@example.com> 2013-03-13 18:51:49 (GMT)
committer Linus Torvalds <firstname.lastname@example.org> 2013-03-13 22:00:20 (GMT)
commit e66eded8309ebf679d3d3c1f5820d1f2ca332c71 (patch)
parent 6c23cbbd5056b155401b0a2b5567d530e6c750c4 (diff)
userns: Don't allow CLONE_NEWUSER | CLONE_FS
Don't allowing sharing the root directory with processes in a different user namespace. There doesn't seem to be any point, and to allow it would require the overhead of putting a user namespace reference in fs_struct (for permission checks) and incrementing that reference count on practically every call to fork. So just perform the inexpensive test of forbidding sharing fs_struct acrosss processes in different user namespaces. We already disallow other forms of threading when unsharing a user namespace so this should be no real burden in practice. This updates setns, clone, and unshare to disallow multiple user namespaces sharing an fs_struct.
Note that this only affects Linux Kernel 3.8, older versipns are not affected.
So no SUSE Linux Enterprise or openSUSE product was affected by this issue.