File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 11
11
#include <linux/user_namespace.h>
12
12
#include <linux/highuid.h>
13
13
#include <linux/cred.h>
14
+ #include <linux/securebits.h>
14
15
15
16
static struct kmem_cache * user_ns_cachep __read_mostly ;
16
17
@@ -52,6 +53,14 @@ int create_user_ns(struct cred *new)
52
53
new -> gid = new -> egid = new -> sgid = new -> fsgid = 0 ;
53
54
put_group_info (new -> group_info );
54
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
64
#ifdef CONFIG_KEYS
56
65
key_put (new -> request_key_auth );
57
66
new -> request_key_auth = NULL ;
You can’t perform that action at this time.
0 commit comments