Skip to content

Commit

Permalink
Fix compat regression in process_vm_rw()
Browse files Browse the repository at this point in the history
The removal of compat_process_vm_{readv,writev} didn't change
process_vm_rw(), which always assumes it's not doing a compat syscall.

Instead of passing in 'false' unconditionally for 'compat', make it
conditional on in_compat_syscall().

[ Both Al and Christoph point out that trying to access a 64-bit process
  from a 32-bit one cannot work anyway, and is likely better prohibited,
  but that's a separate issue    - Linus ]

Fixes: c3973b4 ("mm: remove compat_process_vm_{readv,writev}")
Reported-and-tested-by: Kyle Huey <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Acked-by: Al Viro <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
axboe authored and torvalds committed Oct 27, 2020
1 parent 4525c87 commit 38dc507
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/process_vm_access.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ static ssize_t process_vm_rw(pid_t pid,
return rc;
if (!iov_iter_count(&iter))
goto free_iov_l;
iov_r = iovec_from_user(rvec, riovcnt, UIO_FASTIOV, iovstack_r, false);
iov_r = iovec_from_user(rvec, riovcnt, UIO_FASTIOV, iovstack_r,
in_compat_syscall());
if (IS_ERR(iov_r)) {
rc = PTR_ERR(iov_r);
goto free_iov_l;
Expand Down

0 comments on commit 38dc507

Please sign in to comment.