diff options
author | Alex Shi <alex.shi@linaro.org> | 2017-09-01 12:03:31 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2017-09-01 12:03:31 +0800 |
commit | 7eab57b43413b6e1fda7e2c5c81ad8b02bcb25d0 (patch) | |
tree | 790e02e81fc8e6c82c91cde3adb3d22393216199 /mm | |
parent | 65169f9517a93e80fd1512445095b036c375d1a5 (diff) | |
parent | 2713f9f39b8fd713d914c0051b8dc5acf1bc2c6d (diff) |
Merge tag 'v3.18.68' into linux-linaro-lsk-v3.18
This is the 3.18.68 stable release
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mempolicy.c | 5 | ||||
-rw-r--r-- | mm/migrate.c | 11 |
2 files changed, 3 insertions, 13 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 6a23ccc46f0f..d326955b4d05 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -944,11 +944,6 @@ static long do_get_mempolicy(int *policy, nodemask_t *nmask, *policy |= (pol->flags & MPOL_MODE_FLAGS); } - if (vma) { - up_read(¤t->mm->mmap_sem); - vma = NULL; - } - err = 0; if (nmask) { if (mpol_store_user_nodemask(pol)) { diff --git a/mm/migrate.c b/mm/migrate.c index 3594defceff9..4d743bce5a23 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -37,6 +37,7 @@ #include <linux/gfp.h> #include <linux/balloon_compaction.h> #include <linux/mmu_notifier.h> +#include <linux/ptrace.h> #include <asm/tlbflush.h> @@ -1468,7 +1469,6 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, const int __user *, nodes, int __user *, status, int, flags) { - const struct cred *cred = current_cred(), *tcred; struct task_struct *task; struct mm_struct *mm; int err; @@ -1492,14 +1492,9 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, /* * Check if this process has the right to modify the specified - * process. The right exists if the process has administrative - * capabilities, superuser privileges or the same - * userid as the target process. + * process. Use the regular "ptrace_may_access()" checks. */ - tcred = __task_cred(task); - 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)) { + if (!ptrace_may_access(task, PTRACE_MODE_READ_REALCREDS)) { rcu_read_unlock(); err = -EPERM; goto out; |