diff options
author | Lorenzo Stoakes <lstoakes@gmail.com> | 2016-10-12 20:20:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-19 11:31:25 -0400 |
commit | f307ab6dcea03f9d8e4d70508fd7d1ca57cfa7f9 (patch) | |
tree | 94a96ebae9957cf1252231a69f8904796aa2563e /arch/ia64/kernel | |
parent | 6347e8d5bcce33fc36e651901efefbe2c93a43ef (diff) |
mm: replace access_process_vm() write parameter with gup_flags
This removes the 'write' argument from access_process_vm() and replaces
it with 'gup_flags' as use of this function previously silently implied
FOLL_FORCE, whereas after this patch callers explicitly pass this flag.
We make this explicit as use of FOLL_FORCE can result in surprising
behaviour (and hence bugs) within the mm subsystem.
Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r-- | arch/ia64/kernel/ptrace.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c index 6f54d511cc50..31aa8c0f68e1 100644 --- a/arch/ia64/kernel/ptrace.c +++ b/arch/ia64/kernel/ptrace.c | |||
@@ -453,7 +453,7 @@ ia64_peek (struct task_struct *child, struct switch_stack *child_stack, | |||
453 | return 0; | 453 | return 0; |
454 | } | 454 | } |
455 | } | 455 | } |
456 | copied = access_process_vm(child, addr, &ret, sizeof(ret), 0); | 456 | copied = access_process_vm(child, addr, &ret, sizeof(ret), FOLL_FORCE); |
457 | if (copied != sizeof(ret)) | 457 | if (copied != sizeof(ret)) |
458 | return -EIO; | 458 | return -EIO; |
459 | *val = ret; | 459 | *val = ret; |
@@ -489,7 +489,8 @@ ia64_poke (struct task_struct *child, struct switch_stack *child_stack, | |||
489 | *ia64_rse_skip_regs(krbs, regnum) = val; | 489 | *ia64_rse_skip_regs(krbs, regnum) = val; |
490 | } | 490 | } |
491 | } | 491 | } |
492 | } else if (access_process_vm(child, addr, &val, sizeof(val), 1) | 492 | } else if (access_process_vm(child, addr, &val, sizeof(val), |
493 | FOLL_FORCE | FOLL_WRITE) | ||
493 | != sizeof(val)) | 494 | != sizeof(val)) |
494 | return -EIO; | 495 | return -EIO; |
495 | return 0; | 496 | return 0; |
@@ -543,7 +544,8 @@ ia64_sync_user_rbs (struct task_struct *child, struct switch_stack *sw, | |||
543 | ret = ia64_peek(child, sw, user_rbs_end, addr, &val); | 544 | ret = ia64_peek(child, sw, user_rbs_end, addr, &val); |
544 | if (ret < 0) | 545 | if (ret < 0) |
545 | return ret; | 546 | return ret; |
546 | if (access_process_vm(child, addr, &val, sizeof(val), 1) | 547 | if (access_process_vm(child, addr, &val, sizeof(val), |
548 | FOLL_FORCE | FOLL_WRITE) | ||
547 | != sizeof(val)) | 549 | != sizeof(val)) |
548 | return -EIO; | 550 | return -EIO; |
549 | } | 551 | } |
@@ -559,7 +561,8 @@ ia64_sync_kernel_rbs (struct task_struct *child, struct switch_stack *sw, | |||
559 | 561 | ||
560 | /* now copy word for word from user rbs to kernel rbs: */ | 562 | /* now copy word for word from user rbs to kernel rbs: */ |
561 | for (addr = user_rbs_start; addr < user_rbs_end; addr += 8) { | 563 | for (addr = user_rbs_start; addr < user_rbs_end; addr += 8) { |
562 | if (access_process_vm(child, addr, &val, sizeof(val), 0) | 564 | if (access_process_vm(child, addr, &val, sizeof(val), |
565 | FOLL_FORCE) | ||
563 | != sizeof(val)) | 566 | != sizeof(val)) |
564 | return -EIO; | 567 | return -EIO; |
565 | 568 | ||
@@ -1156,7 +1159,8 @@ arch_ptrace (struct task_struct *child, long request, | |||
1156 | case PTRACE_PEEKTEXT: | 1159 | case PTRACE_PEEKTEXT: |
1157 | case PTRACE_PEEKDATA: | 1160 | case PTRACE_PEEKDATA: |
1158 | /* read word at location addr */ | 1161 | /* read word at location addr */ |
1159 | if (access_process_vm(child, addr, &data, sizeof(data), 0) | 1162 | if (access_process_vm(child, addr, &data, sizeof(data), |
1163 | FOLL_FORCE) | ||
1160 | != sizeof(data)) | 1164 | != sizeof(data)) |
1161 | return -EIO; | 1165 | return -EIO; |
1162 | /* ensure return value is not mistaken for error code */ | 1166 | /* ensure return value is not mistaken for error code */ |