diff options
| author | Ingo Molnar <mingo@kernel.org> | 2013-03-21 11:03:10 +0100 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2013-03-21 11:03:10 +0100 |
| commit | 3bf2391729822e591dcfbbd1e9dd2f450968cdcb (patch) | |
| tree | 80a0499e57a4cc95b6caea559400b5226ebe606f /kernel/user_namespace.c | |
| parent | 86e213e1d901fbeaf6e57d13c5edd925fadddcbe (diff) | |
| parent | fd4a5aef002bb57e8a35ed34d8a878034b9bde94 (diff) | |
Merge branch 'perf/urgent' into perf/core
Merge in all pending fixes, before pulling the latest development
bits from Arnaldo - which will involve merge conflicts.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
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 8b650837083..b14f4d34204 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; |
