aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index f7a43514ac65..82d8714bbede 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -133,11 +133,11 @@ static bool set_one_prio_perm(struct task_struct *p)
133{ 133{
134 const struct cred *cred = current_cred(), *pcred = __task_cred(p); 134 const struct cred *cred = current_cred(), *pcred = __task_cred(p);
135 135
136 if (pcred->user->user_ns == cred->user->user_ns && 136 if (pcred->user_ns == cred->user_ns &&
137 (pcred->uid == cred->euid || 137 (pcred->uid == cred->euid ||
138 pcred->euid == cred->euid)) 138 pcred->euid == cred->euid))
139 return true; 139 return true;
140 if (ns_capable(pcred->user->user_ns, CAP_SYS_NICE)) 140 if (ns_capable(pcred->user_ns, CAP_SYS_NICE))
141 return true; 141 return true;
142 return false; 142 return false;
143} 143}
@@ -1498,7 +1498,7 @@ static int check_prlimit_permission(struct task_struct *task)
1498 return 0; 1498 return 0;
1499 1499
1500 tcred = __task_cred(task); 1500 tcred = __task_cred(task);
1501 if (cred->user->user_ns == tcred->user->user_ns && 1501 if (cred->user_ns == tcred->user_ns &&
1502 (cred->uid == tcred->euid && 1502 (cred->uid == tcred->euid &&
1503 cred->uid == tcred->suid && 1503 cred->uid == tcred->suid &&
1504 cred->uid == tcred->uid && 1504 cred->uid == tcred->uid &&
@@ -1506,7 +1506,7 @@ static int check_prlimit_permission(struct task_struct *task)
1506 cred->gid == tcred->sgid && 1506 cred->gid == tcred->sgid &&
1507 cred->gid == tcred->gid)) 1507 cred->gid == tcred->gid))
1508 return 0; 1508 return 0;
1509 if (ns_capable(tcred->user->user_ns, CAP_SYS_RESOURCE)) 1509 if (ns_capable(tcred->user_ns, CAP_SYS_RESOURCE))
1510 return 0; 1510 return 0;
1511 1511
1512 return -EPERM; 1512 return -EPERM;