mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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: f889491380 ("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]>
This commit is contained in:
parent
98239c9096
commit
7ced6c98c7
1 changed files with 1 additions and 1 deletions
|
|
@ -744,7 +744,7 @@ static int vhost_copy_to_user(struct vhost_virtqueue *vq, void __user *to,
|
|||
struct iov_iter t;
|
||||
void __user *uaddr = vhost_vq_meta_fetch(vq,
|
||||
(u64)(uintptr_t)to, size,
|
||||
VHOST_ADDR_DESC);
|
||||
VHOST_ADDR_USED);
|
||||
|
||||
if (uaddr)
|
||||
return __copy_to_user(uaddr, from, size);
|
||||
|
|
|
|||
Loading…
Reference in a new issue