aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2011-11-17 04:59:07 -0500
committerEric W. Biederman <ebiederm@xmission.com>2012-04-07 19:55:59 -0400
commit973c5914260d75292f71a4729753086b9e863d57 (patch)
treeb194688d30f2f05debd24605650edba0509bbcad /kernel
parentd0bd6594e286bd6145e04e19e8d3fa2e902cb800 (diff)
userns: Start out with a full set of capabilities.
Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/user_namespace.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index c15e533d6bc..e216e1e8ce8 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -11,6 +11,7 @@
11#include <linux/user_namespace.h> 11#include <linux/user_namespace.h>
12#include <linux/highuid.h> 12#include <linux/highuid.h>
13#include <linux/cred.h> 13#include <linux/cred.h>
14#include <linux/securebits.h>
14 15
15static struct kmem_cache *user_ns_cachep __read_mostly; 16static struct kmem_cache *user_ns_cachep __read_mostly;
16 17
@@ -52,6 +53,14 @@ int create_user_ns(struct cred *new)
52 new->gid = new->egid = new->sgid = new->fsgid = 0; 53 new->gid = new->egid = new->sgid = new->fsgid = 0;
53 put_group_info(new->group_info); 54 put_group_info(new->group_info);
54 new->group_info = get_group_info(&init_groups); 55 new->group_info = get_group_info(&init_groups);
56 /* Start with the same capabilities as init but useless for doing
57 * anything as the capabilities are bound to the new user namespace.
58 */
59 new->securebits = SECUREBITS_DEFAULT;
60 new->cap_inheritable = CAP_EMPTY_SET;
61 new->cap_permitted = CAP_FULL_SET;
62 new->cap_effective = CAP_FULL_SET;
63 new->cap_bset = CAP_FULL_SET;
55#ifdef CONFIG_KEYS 64#ifdef CONFIG_KEYS
56 key_put(new->request_key_auth); 65 key_put(new->request_key_auth);
57 new->request_key_auth = NULL; 66 new->request_key_auth = NULL;