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>
This commit is contained in:

committed by
Linus Torvalds

parent
6347e8d5bc
commit
f307ab6dce
@@ -70,7 +70,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
|
||||
break;
|
||||
|
||||
copied = access_process_vm(child, (u64)addrOthers, &tmp,
|
||||
sizeof(tmp), 0);
|
||||
sizeof(tmp), FOLL_FORCE);
|
||||
if (copied != sizeof(tmp))
|
||||
break;
|
||||
ret = put_user(tmp, (u32 __user *) (unsigned long) data);
|
||||
@@ -179,7 +179,8 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
|
||||
break;
|
||||
ret = 0;
|
||||
if (access_process_vm(child, (u64)addrOthers, &data,
|
||||
sizeof(data), 1) == sizeof(data))
|
||||
sizeof(data),
|
||||
FOLL_FORCE | FOLL_WRITE) == sizeof(data))
|
||||
break;
|
||||
ret = -EIO;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user