Commit 38dc5079 authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

Fix compat regression in process_vm_rw()

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: c3973b40 ("mm: remove compat_process_vm_{readv,writev}")
Reported-and-tested-by: default avatarKyle Huey <me@kylehuey.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4525c878
...@@ -273,7 +273,8 @@ static ssize_t process_vm_rw(pid_t pid, ...@@ -273,7 +273,8 @@ static ssize_t process_vm_rw(pid_t pid,
return rc; return rc;
if (!iov_iter_count(&iter)) if (!iov_iter_count(&iter))
goto free_iov_l; 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)) { if (IS_ERR(iov_r)) {
rc = PTR_ERR(iov_r); rc = PTR_ERR(iov_r);
goto free_iov_l; goto free_iov_l;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment