diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-02-02 21:54:02 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-05-03 06:28:39 -0400 |
commit | 9c806aa06f8e121c6058db8e8073798aa5c4355b (patch) | |
tree | d55fb9702aa80c4fb38f0da504b18a720e91f9bb /kernel/sched/core.c | |
parent | 76b6db010297d4928ab7b7e7c78dd982f413f0a4 (diff) |
userns: Convert sched_set_affinity and sched_set_scheduler's permission checks
- Compare kuids with uid_eq
- kuid are uniuqe across all user namespaces so there is no longer the
need for a user_namespace comparison.
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r-- | kernel/sched/core.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 96bff855b866..b189fecaef90 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -4042,11 +4042,8 @@ static bool check_same_owner(struct task_struct *p) | |||
4042 | 4042 | ||
4043 | rcu_read_lock(); | 4043 | rcu_read_lock(); |
4044 | pcred = __task_cred(p); | 4044 | pcred = __task_cred(p); |
4045 | if (cred->user_ns == pcred->user_ns) | 4045 | match = (uid_eq(cred->euid, pcred->euid) || |
4046 | match = (cred->euid == pcred->euid || | 4046 | uid_eq(cred->euid, pcred->uid)); |
4047 | cred->euid == pcred->uid); | ||
4048 | else | ||
4049 | match = false; | ||
4050 | rcu_read_unlock(); | 4047 | rcu_read_unlock(); |
4051 | return match; | 4048 | return match; |
4052 | } | 4049 | } |