aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/user.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/user.c')
-rw-r--r--kernel/user.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/kernel/user.c b/kernel/user.c
index aefbbfa3159f..865ecf57a096 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -384,7 +384,7 @@ void free_uid(struct user_struct *up)
384 local_irq_restore(flags); 384 local_irq_restore(flags);
385} 385}
386 386
387struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid) 387struct user_struct *alloc_uid(struct user_namespace *ns, uid_t uid)
388{ 388{
389 struct hlist_head *hashent = uidhashentry(ns, uid); 389 struct hlist_head *hashent = uidhashentry(ns, uid);
390 struct user_struct *up, *new; 390 struct user_struct *up, *new;
@@ -399,26 +399,12 @@ struct user_struct * alloc_uid(struct user_namespace *ns, uid_t uid)
399 spin_unlock_irq(&uidhash_lock); 399 spin_unlock_irq(&uidhash_lock);
400 400
401 if (!up) { 401 if (!up) {
402 new = kmem_cache_alloc(uid_cachep, GFP_KERNEL); 402 new = kmem_cache_zalloc(uid_cachep, GFP_KERNEL);
403 if (!new) 403 if (!new)
404 goto out_unlock; 404 goto out_unlock;
405 405
406 new->uid = uid; 406 new->uid = uid;
407 atomic_set(&new->__count, 1); 407 atomic_set(&new->__count, 1);
408 atomic_set(&new->processes, 0);
409 atomic_set(&new->files, 0);
410 atomic_set(&new->sigpending, 0);
411#ifdef CONFIG_INOTIFY_USER
412 atomic_set(&new->inotify_watches, 0);
413 atomic_set(&new->inotify_devs, 0);
414#endif
415#ifdef CONFIG_POSIX_MQUEUE
416 new->mq_bytes = 0;
417#endif
418 new->locked_shm = 0;
419#ifdef CONFIG_KEYS
420 new->uid_keyring = new->session_keyring = NULL;
421#endif
422 408
423 if (sched_create_user(new) < 0) 409 if (sched_create_user(new) < 0)
424 goto out_free_user; 410 goto out_free_user;