Commit 9c806aa0 authored by Eric W. Biederman's avatar Eric W. Biederman
Browse files

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: default avatarSerge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
parent 76b6db01
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -4042,11 +4042,8 @@ static bool check_same_owner(struct task_struct *p)

	rcu_read_lock();
	pcred = __task_cred(p);
	if (cred->user_ns == pcred->user_ns)
		match = (cred->euid == pcred->euid ||
			 cred->euid == pcred->uid);
	else
		match = false;
	match = (uid_eq(cred->euid, pcred->euid) ||
		 uid_eq(cred->euid, pcred->uid));
	rcu_read_unlock();
	return match;
}