aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/user.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/user.c')
-rw-r--r--kernel/user.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/user.c b/kernel/user.c
index 750acffbe9ec..8e635a18ab52 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -16,6 +16,7 @@
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/export.h> 17#include <linux/export.h>
18#include <linux/user_namespace.h> 18#include <linux/user_namespace.h>
19#include <linux/proc_fs.h>
19 20
20/* 21/*
21 * userns count is 1 for root user, 1 for init_uts_ns, 22 * userns count is 1 for root user, 1 for init_uts_ns,
@@ -46,11 +47,12 @@ struct user_namespace init_user_ns = {
46 .count = 4294967295U, 47 .count = 4294967295U,
47 }, 48 },
48 }, 49 },
49 .kref = { 50 .count = ATOMIC_INIT(3),
50 .refcount = ATOMIC_INIT(3),
51 },
52 .owner = GLOBAL_ROOT_UID, 51 .owner = GLOBAL_ROOT_UID,
53 .group = GLOBAL_ROOT_GID, 52 .group = GLOBAL_ROOT_GID,
53 .proc_inum = PROC_USER_INIT_INO,
54 .may_mount_sysfs = true,
55 .may_mount_proc = true,
54}; 56};
55EXPORT_SYMBOL_GPL(init_user_ns); 57EXPORT_SYMBOL_GPL(init_user_ns);
56 58
@@ -105,9 +107,8 @@ static void uid_hash_remove(struct user_struct *up)
105static struct user_struct *uid_hash_find(kuid_t uid, struct hlist_head *hashent) 107static struct user_struct *uid_hash_find(kuid_t uid, struct hlist_head *hashent)
106{ 108{
107 struct user_struct *user; 109 struct user_struct *user;
108 struct hlist_node *h;
109 110
110 hlist_for_each_entry(user, h, hashent, uidhash_node) { 111 hlist_for_each_entry(user, hashent, uidhash_node) {
111 if (uid_eq(user->uid, uid)) { 112 if (uid_eq(user->uid, uid)) {
112 atomic_inc(&user->__count); 113 atomic_inc(&user->__count);
113 return user; 114 return user;