mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
vhost: Fix vhost_copy_to_user()
[ Upstream commit7ced6c98c7] 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:f889491380("vhost: introduce O(1) vq metadata cache") Signed-off-by: Eric Auger <eric.auger@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0c2d18968e
commit
73f1e78eb1
@@ -744,7 +744,7 @@ static int vhost_copy_to_user(struct vhost_virtqueue *vq, void __user *to,
|
|||||||
struct iov_iter t;
|
struct iov_iter t;
|
||||||
void __user *uaddr = vhost_vq_meta_fetch(vq,
|
void __user *uaddr = vhost_vq_meta_fetch(vq,
|
||||||
(u64)(uintptr_t)to, size,
|
(u64)(uintptr_t)to, size,
|
||||||
VHOST_ADDR_DESC);
|
VHOST_ADDR_USED);
|
||||||
|
|
||||||
if (uaddr)
|
if (uaddr)
|
||||||
return __copy_to_user(uaddr, from, size);
|
return __copy_to_user(uaddr, from, size);
|
||||||
|
|||||||
Reference in New Issue
Block a user