From 89cd35c58bc2e36bfdc23dde67a429b08cf4ae03 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 25 Sep 2020 06:51:41 +0200 Subject: iov_iter: transparently handle compat iovecs in import_iovec Use in compat_syscall to import either native or the compat iovecs, and remove the now superflous compat_import_iovec. This removes the need for special compat logic in most callers, and the remaining ones can still be simplified by using __import_iovec with a bool compat parameter. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro --- mm/process_vm_access.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mm/process_vm_access.c') diff --git a/mm/process_vm_access.c b/mm/process_vm_access.c index 5e728c20c2be..3f2156aab442 100644 --- a/mm/process_vm_access.c +++ b/mm/process_vm_access.c @@ -326,7 +326,8 @@ compat_process_vm_rw(compat_pid_t pid, if (flags != 0) return -EINVAL; - rc = compat_import_iovec(dir, lvec, liovcnt, UIO_FASTIOV, &iov_l, &iter); + rc = import_iovec(dir, (const struct iovec __user *)lvec, liovcnt, + UIO_FASTIOV, &iov_l, &iter); if (rc < 0) return rc; if (!iov_iter_count(&iter)) -- cgit