aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 872271ccc384..ed92e2f03342 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -35,6 +35,7 @@
35#include <linux/compat.h> 35#include <linux/compat.h>
36#include <linux/syscalls.h> 36#include <linux/syscalls.h>
37#include <linux/kprobes.h> 37#include <linux/kprobes.h>
38#include <linux/user_namespace.h>
38 39
39#include <asm/uaccess.h> 40#include <asm/uaccess.h>
40#include <asm/io.h> 41#include <asm/io.h>
@@ -1078,13 +1079,13 @@ static int set_user(uid_t new_ruid, int dumpclear)
1078{ 1079{
1079 struct user_struct *new_user; 1080 struct user_struct *new_user;
1080 1081
1081 new_user = alloc_uid(new_ruid); 1082 new_user = alloc_uid(current->nsproxy->user_ns, new_ruid);
1082 if (!new_user) 1083 if (!new_user)
1083 return -EAGAIN; 1084 return -EAGAIN;
1084 1085
1085 if (atomic_read(&new_user->processes) >= 1086 if (atomic_read(&new_user->processes) >=
1086 current->signal->rlim[RLIMIT_NPROC].rlim_cur && 1087 current->signal->rlim[RLIMIT_NPROC].rlim_cur &&
1087 new_user != &root_user) { 1088 new_user != current->nsproxy->user_ns->root_user) {
1088 free_uid(new_user); 1089 free_uid(new_user);
1089 return -EAGAIN; 1090 return -EAGAIN;
1090 } 1091 }