diff options
author | Christoph Hellwig <hch@lst.de> | 2021-01-11 18:19:26 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-01-27 11:55:09 +0100 |
commit | 37d4f78ae274d11c26eb7deb912f8fdf12bd2283 (patch) | |
tree | 6bb43f011ef0b8bbf5dcf4ed9969c73fa8ab724c /lib | |
parent | ce4d02da78a30e6ba6ed61a745900ae49985ba1e (diff) | |
download | linux-stable-37d4f78ae274d11c26eb7deb912f8fdf12bd2283.tar.gz linux-stable-37d4f78ae274d11c26eb7deb912f8fdf12bd2283.tar.bz2 linux-stable-37d4f78ae274d11c26eb7deb912f8fdf12bd2283.zip |
iov_iter: fix the uaccess area in copy_compat_iovec_from_user
[ Upstream commit a959a9782fa87669feeed095ced5d78181a7c02d ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib')
-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++) { |