Skip to content

Commit a959a97

Browse files
Christoph HellwigAl Viro
authored andcommitted
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: 89cd35c ("iov_iter: transparently handle compat iovecs in import_iovec") Reported-by: David Laight <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent a0a6df9 commit a959a97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/iov_iter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1658,7 +1658,7 @@ static int copy_compat_iovec_from_user(struct iovec *iov,
16581658
(const struct compat_iovec __user *)uvec;
16591659
int ret = -EFAULT, i;
16601660

1661-
if (!user_access_begin(uvec, nr_segs * sizeof(*uvec)))
1661+
if (!user_access_begin(uiov, nr_segs * sizeof(*uiov)))
16621662
return -EFAULT;
16631663

16641664
for (i = 0; i < nr_segs; i++) {

0 commit comments

Comments
 (0)