aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index c3b8b1fcde0d..733c59e645aa 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -345,7 +345,7 @@ static inline struct task_group *task_group(struct task_struct *p)
345 struct task_group *tg; 345 struct task_group *tg;
346 346
347#ifdef CONFIG_USER_SCHED 347#ifdef CONFIG_USER_SCHED
348 tg = p->user->tg; 348 tg = p->cred->user->tg;
349#elif defined(CONFIG_CGROUP_SCHED) 349#elif defined(CONFIG_CGROUP_SCHED)
350 tg = container_of(task_subsys_state(p, cpu_cgroup_subsys_id), 350 tg = container_of(task_subsys_state(p, cpu_cgroup_subsys_id),
351 struct task_group, css); 351 struct task_group, css);
@@ -5182,8 +5182,8 @@ recheck:
5182 5182
5183 /* can't change other user's priorities */ 5183 /* can't change other user's priorities */
5184 euid = current_euid(); 5184 euid = current_euid();
5185 if (euid != p->euid && 5185 if (euid != p->cred->euid &&
5186 euid != p->uid) 5186 euid != p->cred->uid)
5187 return -EPERM; 5187 return -EPERM;
5188 } 5188 }
5189 5189
@@ -5417,7 +5417,9 @@ long sched_setaffinity(pid_t pid, const cpumask_t *in_mask)
5417 5417
5418 euid = current_euid(); 5418 euid = current_euid();
5419 retval = -EPERM; 5419 retval = -EPERM;
5420 if (euid != p->euid && euid != p->uid && !capable(CAP_SYS_NICE)) 5420 if (euid != p->cred->euid &&
5421 euid != p->cred->uid &&
5422 !capable(CAP_SYS_NICE))
5421 goto out_unlock; 5423 goto out_unlock;
5422 5424
5423 retval = security_task_setscheduler(p, 0, NULL); 5425 retval = security_task_setscheduler(p, 0, NULL);