aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/user.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/user.c')
-rw-r--r--kernel/user.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/user.c b/kernel/user.c
index bc1c48d35cb3..7d7900c5a1fd 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -17,6 +17,14 @@
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/user_namespace.h> 18#include <linux/user_namespace.h>
19 19
20struct user_namespace init_user_ns = {
21 .kref = {
22 .refcount = ATOMIC_INIT(2),
23 },
24 .root_user = &root_user,
25};
26EXPORT_SYMBOL_GPL(init_user_ns);
27
20/* 28/*
21 * UID task count cache, to get fast user lookup in "alloc_uid" 29 * UID task count cache, to get fast user lookup in "alloc_uid"
22 * when changing user ID's (ie setuid() and friends). 30 * when changing user ID's (ie setuid() and friends).
@@ -427,6 +435,7 @@ void switch_uid(struct user_struct *new_user)
427 suid_keys(current); 435 suid_keys(current);
428} 436}
429 437
438#ifdef CONFIG_USER_NS
430void release_uids(struct user_namespace *ns) 439void release_uids(struct user_namespace *ns)
431{ 440{
432 int i; 441 int i;
@@ -451,6 +460,7 @@ void release_uids(struct user_namespace *ns)
451 460
452 free_uid(ns->root_user); 461 free_uid(ns->root_user);
453} 462}
463#endif
454 464
455static int __init uid_cache_init(void) 465static int __init uid_cache_init(void)
456{ 466{