diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-03-13 02:48:24 +0400 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-05-16 01:59:30 +0400 |
commit | b38a86eb196d9402299919456fe3f28e490c76fa (patch) | |
tree | 7e5527ceb26989c48342ab1660de117ccd159279 /mm/migrate.c | |
parent | 14a590c3f987977d7b09ec926481ee0238c08eee (diff) | |
download | linux-b38a86eb196d9402299919456fe3f28e490c76fa.tar.xz |
userns: Convert the move_pages, and migrate_pages permission checks to use uid_eq
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'mm/migrate.c')
-rw-r--r-- | mm/migrate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index 51c08a0c6f68..1cf5252c3b99 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1371,8 +1371,8 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, * userid as the target process. */ tcred = __task_cred(task); - if (cred->euid != tcred->suid && cred->euid != tcred->uid && - cred->uid != tcred->suid && cred->uid != tcred->uid && + if (!uid_eq(cred->euid, tcred->suid) && !uid_eq(cred->euid, tcred->uid) && + !uid_eq(cred->uid, tcred->suid) && !uid_eq(cred->uid, tcred->uid) && !capable(CAP_SYS_NICE)) { rcu_read_unlock(); err = -EPERM; |