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 <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Christoph Hellwig
2020-09-25 06:51:41 +02:00
committed by Al Viro
parent bfdc59701d
commit 89cd35c58b
11 changed files with 26 additions and 65 deletions

View File

@@ -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))