aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index ab735040468a..ebe65c2c9873 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -565,13 +565,13 @@ static int set_user(struct cred *new)
565{ 565{
566 struct user_struct *new_user; 566 struct user_struct *new_user;
567 567
568 new_user = alloc_uid(current->nsproxy->user_ns, new->uid); 568 new_user = alloc_uid(current_user_ns(), new->uid);
569 if (!new_user) 569 if (!new_user)
570 return -EAGAIN; 570 return -EAGAIN;
571 571
572 if (atomic_read(&new_user->processes) >= 572 if (atomic_read(&new_user->processes) >=
573 current->signal->rlim[RLIMIT_NPROC].rlim_cur && 573 current->signal->rlim[RLIMIT_NPROC].rlim_cur &&
574 new_user != current->nsproxy->user_ns->root_user) { 574 new_user != INIT_USER) {
575 free_uid(new_user); 575 free_uid(new_user);
576 return -EAGAIN; 576 return -EAGAIN;
577 } 577 }