Skip to content

Commit 38dc507

Browse files
axboetorvalds
authored andcommitted
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: c3973b4 ("mm: remove compat_process_vm_{readv,writev}") Reported-and-tested-by: Kyle Huey <me@kylehuey.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Acked-by: Al Viro <viro@zeniv.linux.org.uk> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 4525c87 commit 38dc507

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

mm/process_vm_access.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ static ssize_t process_vm_rw(pid_t pid,
273273
return rc;
274274
if (!iov_iter_count(&iter))
275275
goto free_iov_l;
276-
iov_r = iovec_from_user(rvec, riovcnt, UIO_FASTIOV, iovstack_r, false);
276+
iov_r = iovec_from_user(rvec, riovcnt, UIO_FASTIOV, iovstack_r,
277+
in_compat_syscall());
277278
if (IS_ERR(iov_r)) {
278279
rc = PTR_ERR(iov_r);
279280
goto free_iov_l;

0 commit comments

Comments
 (0)