diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-04-25 09:42:42 +0100 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-04-25 09:42:42 +0100 |
| commit | a126f7c41d80322b42ae0383ed3dcb17ee0296fc (patch) | |
| tree | 67f3605e72e01f7ec0b15af22d9d7b6ef8598b55 /kernel/user_namespace.c | |
| parent | 0098fc39e6d575f940487f09f303787efbc7a373 (diff) | |
| parent | a7eb7c6f9a657a01a8359edae31bbeacd18b072c (diff) | |
Merge branch 'mcpm' of git://git.linaro.org/people/nico/linux into devel-stable
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; |
