diff options
authorJens Axboe <>2020-10-26 18:03:18 -0600
committerLinus Torvalds <>2020-10-27 09:57:46 -0700
commit38dc5079da7081e8b09b14e255e9da82c451a531 (patch)
parent4525c8781ec0701ce824e8bd379ae1b129e26568 (diff)
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: c3973b401ef2 ("mm: remove compat_process_vm_{readv,writev}") Reported-and-tested-by: Kyle Huey <> Signed-off-by: Jens Axboe <> Acked-by: Al Viro <> Reviewed-by: Christoph Hellwig <> Signed-off-by: Linus Torvalds <>
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/process_vm_access.c b/mm/process_vm_access.c
index fd12da80b6f2..05676722d9cd 100644
--- a/mm/process_vm_access.c
+++ b/mm/process_vm_access.c
@@ -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;