diff options
author | Christoph Hellwig <hch@lst.de> | 2021-01-11 20:19:26 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2021-01-16 06:51:42 +0300 |
commit | a959a9782fa87669feeed095ced5d78181a7c02d (patch) | |
tree | 99f8eb6dede1e8eaf467e4513e22a837ae673995 /lib/iov_iter.c | |
parent | a0a6df9afcaf439a6b4c88a3b522e3d05fdef46f (diff) | |
download | linux-a959a9782fa87669feeed095ced5d78181a7c02d.tar.xz |
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/iov_iter.c')
-rw-r--r-- | lib/iov_iter.c | 2 |
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++) { |