diff options
Diffstat (limited to 'mm/migrate.c')
-rw-r--r-- | mm/migrate.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index 72c09dea6526..afedcfab60e2 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/balloon_compaction.h> | 38 | #include <linux/balloon_compaction.h> |
39 | #include <linux/mmu_notifier.h> | 39 | #include <linux/mmu_notifier.h> |
40 | #include <linux/page_idle.h> | 40 | #include <linux/page_idle.h> |
41 | #include <linux/ptrace.h> | ||
41 | 42 | ||
42 | #include <asm/tlbflush.h> | 43 | #include <asm/tlbflush.h> |
43 | 44 | ||
@@ -1483,7 +1484,6 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, | |||
1483 | const int __user *, nodes, | 1484 | const int __user *, nodes, |
1484 | int __user *, status, int, flags) | 1485 | int __user *, status, int, flags) |
1485 | { | 1486 | { |
1486 | const struct cred *cred = current_cred(), *tcred; | ||
1487 | struct task_struct *task; | 1487 | struct task_struct *task; |
1488 | struct mm_struct *mm; | 1488 | struct mm_struct *mm; |
1489 | int err; | 1489 | int err; |
@@ -1507,14 +1507,9 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, | |||
1507 | 1507 | ||
1508 | /* | 1508 | /* |
1509 | * Check if this process has the right to modify the specified | 1509 | * Check if this process has the right to modify the specified |
1510 | * process. The right exists if the process has administrative | 1510 | * process. Use the regular "ptrace_may_access()" checks. |
1511 | * capabilities, superuser privileges or the same | ||
1512 | * userid as the target process. | ||
1513 | */ | 1511 | */ |
1514 | tcred = __task_cred(task); | 1512 | if (!ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS)) { |
1515 | if (!uid_eq(cred->euid, tcred->suid) && !uid_eq(cred->euid, tcred->uid) && | ||
1516 | !uid_eq(cred->uid, tcred->suid) && !uid_eq(cred->uid, tcred->uid) && | ||
1517 | !capable(CAP_SYS_NICE)) { | ||
1518 | rcu_read_unlock(); | 1513 | rcu_read_unlock(); |
1519 | err = -EPERM; | 1514 | err = -EPERM; |
1520 | goto out; | 1515 | goto out; |