summaryrefslogtreecommitdiffstats
path: root/lib/iov_iter.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-01-11 18:19:26 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2021-01-16 04:51:42 +0100
commita959a9782fa87669feeed095ced5d78181a7c02d (patch)
tree99f8eb6dede1e8eaf467e4513e22a837ae673995 /lib/iov_iter.c
parentumount(2): move the flag validity checks first (diff)
downloadlinux-a959a9782fa87669feeed095ced5d78181a7c02d.tar.xz
linux-a959a9782fa87669feeed095ced5d78181a7c02d.zip
iov_iter: fix the uaccess area in copy_compat_iovec_from_user
sizeof needs to be called on the compat pointer, not the native one. Fixes: 89cd35c58bc2 ("iov_iter: transparently handle compat iovecs in import_iovec") Reported-by: David Laight <David.Laight@ACULAB.COM> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to '')
-rw-r--r--lib/iov_iter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 1635111c5bd2..a21e6a5792c5 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -1658,7 +1658,7 @@ static int copy_compat_iovec_from_user(struct iovec *iov,
(const struct compat_iovec __user *)uvec;
int ret = -EFAULT, i;
- if (!user_access_begin(uvec, nr_segs * sizeof(*uvec)))
+ if (!user_access_begin(uiov, nr_segs * sizeof(*uiov)))
return -EFAULT;
for (i = 0; i < nr_segs; i++) {