Skip to content

Commit 7ced6c9

Browse files
eaugerdavem330
authored andcommitted
vhost: Fix vhost_copy_to_user()
vhost_copy_to_user is used to copy vring used elements to userspace. We should use VHOST_ADDR_USED instead of VHOST_ADDR_DESC. Fixes: f889491 ("vhost: introduce O(1) vq metadata cache") Signed-off-by: Eric Auger <[email protected]> Acked-by: Jason Wang <[email protected]> Acked-by: Michael S. Tsirkin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 98239c9 commit 7ced6c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/vhost/vhost.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ static int vhost_copy_to_user(struct vhost_virtqueue *vq, void __user *to,
744744
struct iov_iter t;
745745
void __user *uaddr = vhost_vq_meta_fetch(vq,
746746
(u64)(uintptr_t)to, size,
747-
VHOST_ADDR_DESC);
747+
VHOST_ADDR_USED);
748748

749749
if (uaddr)
750750
return __copy_to_user(uaddr, from, size);

0 commit comments

Comments
 (0)