提交 9c806aa0 编写于 作者: E Eric W. Biederman

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: NSerge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
上级 76b6db01
...@@ -4042,11 +4042,8 @@ static bool check_same_owner(struct task_struct *p) ...@@ -4042,11 +4042,8 @@ static bool check_same_owner(struct task_struct *p)
rcu_read_lock(); rcu_read_lock();
pcred = __task_cred(p); pcred = __task_cred(p);
if (cred->user_ns == pcred->user_ns) match = (uid_eq(cred->euid, pcred->euid) ||
match = (cred->euid == pcred->euid || uid_eq(cred->euid, pcred->uid));
cred->euid == pcred->uid);
else
match = false;
rcu_read_unlock(); rcu_read_unlock();
return match; return match;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册