summaryrefslogtreecommitdiffstats
path: root/lib
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-15 22:51:42 -0500
commita959a9782fa87669feeed095ced5d78181a7c02d (patch)
tree99f8eb6dede1e8eaf467e4513e22a837ae673995 /lib
parenta0a6df9afcaf439a6b4c88a3b522e3d05fdef46f (diff)
downloadlinux-a959a9782fa87669feeed095ced5d78181a7c02d.tar.gz
linux-a959a9782fa87669feeed095ced5d78181a7c02d.tar.bz2
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 'lib')
-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++) {