All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix compat regression in process_vm_rw()
@ 2020-10-27  0:03 Jens Axboe
  2020-10-27  0:09 ` Al Viro
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Jens Axboe @ 2020-10-27  0:03 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, Christoph Hellwig, Kyle Huey

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().

Fixes: c3973b401ef2 ("mm: remove compat_process_vm_{readv,writev}")
Reported-by: Kyle Huey <me@kylehuey.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

---

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;

-- 
Jens Axboe


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-10-27 19:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27  0:03 [PATCH] Fix compat regression in process_vm_rw() Jens Axboe
2020-10-27  0:09 ` Al Viro
2020-10-27  8:01   ` Christoph Hellwig
2020-10-27 17:00     ` Linus Torvalds
2020-10-27  0:47 ` Kyle Huey
2020-10-27  8:00 ` Christoph Hellwig
2020-10-27 19:19 ` damian
2020-10-27 19:27   ` Naresh Kamboju
2020-10-27 19:32   ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.