summaryrefslogtreecommitdiff
path: root/kernel/user_namespace.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-25 08:34:47 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-25 08:34:47 -0700
commit91721197def2fc69abf152c47dbb87eed0f13333 (patch)
tree80b4b92f44a7a3b1ada346c175489b0274fe1344 /kernel/user_namespace.c
parent8f46baaa7ec6cd0851794020b31958e64679dd26 (diff)
parent8bb9660418e05bb1845ac1a2428444d78e322cc7 (diff)
Merge 3.9-rc4 into driver-core-next
Diffstat (limited to 'kernel/user_namespace.c')
-rw-r--r--kernel/user_namespace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index 8b650837083e..b14f4d342043 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -21,6 +21,7 @@
#include <linux/uaccess.h>
#include <linux/ctype.h>
#include <linux/projid.h>
+#include <linux/fs_struct.h>
static struct kmem_cache *user_ns_cachep __read_mostly;
@@ -837,6 +838,9 @@ static int userns_install(struct nsproxy *nsproxy, void *ns)
if (atomic_read(&current->mm->mm_users) > 1)
return -EINVAL;
+ if (current->fs->users != 1)
+ return -EINVAL;
+
if (!ns_capable(user_ns, CAP_SYS_ADMIN))
return -EPERM;