diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-21 16:07:34 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-21 16:07:34 -0700 |
commit | 23a376f98c5dcfc392d47e8d1872884ff44e585d (patch) | |
tree | dbe476151bbd6530369c40746f2ec2365f7b500a /kernel/user_namespace.c | |
parent | 8358f6242dd447a4f694c7bc949bbfc842ca5db1 (diff) | |
parent | a937536b868b8369b98967929045f1df54234323 (diff) |
Merge 3.9-rc3 into tty-next
Diffstat (limited to 'kernel/user_namespace.c')
-rw-r--r-- | kernel/user_namespace.c | 4 |
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(¤t->mm->mm_users) > 1) return -EINVAL; + if (current->fs->users != 1) + return -EINVAL; + if (!ns_capable(user_ns, CAP_SYS_ADMIN)) return -EPERM; |