vhost: Fix vhost_copy_to_user()
Subsystems (6)
PATCH 1/1 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.
---
This fixes a stall observed when running an aarch64 guest with virtual smmu
--- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vhost/vhost.c +1 -1
@@ -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);
Signature · 1 line
2.5.5
Quoted 19 lines · Eric Auger
vhost_copy_to_useris used to copy vring used elements to userspace. We should useVHOST_ADDR_USEDinstead ofVHOST_ADDR_DESC.Fixes f88949138058 ("vhost: introduce O(1) vq metadata cache")Signed-off-by Eric Auger <[email protected]>---
This fixes a stall observed when running an aarch64 guest with virtual smmu
--- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vhost/vhost.c +0
-0
drivers/vhost/vhost.c static int vhost_copy_to_user(struct vhost_virtqueue *vq, void __user *to, · line 750
Quoted 8 lines
drivers/vhost/vhost.c +1
-1@@ -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);
Thanks!
Stable material I think.
Hi Jason,
Quoted 33 lines · Jason Wang
Quoted 19 lines · Eric Auger
vhost_copy_to_useris used to copy vring used elements to userspace. We should useVHOST_ADDR_USEDinstead ofVHOST_ADDR_DESC.Fixes f88949138058 ("vhost: introduce O(1) vq metadata cache")Signed-off-by Eric Auger <[email protected]>---
This fixes a stall observed when running an aarch64 guest with virtual smmu
--- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vhost/vhost.c +0
-0drivers/vhost/vhost.c static int vhost_copy_to_user(struct · line 750
Quoted 8 lines
drivers/vhost/vhost.c +1
-1@@ -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);Acked-by Jason Wang <[email protected]>
Quoted 3 lines
Thanks!
Stable material I think.
yes I think so.
Thanks
Eric
Hi Jason,
Quoted 33 lines · Jason Wang
Quoted 19 lines · Eric Auger
vhost_copy_to_useris used to copy vring used elements to userspace. We should useVHOST_ADDR_USEDinstead ofVHOST_ADDR_DESC.Fixes f88949138058 ("vhost: introduce O(1) vq metadata cache")Signed-off-by Eric Auger <[email protected]>---
This fixes a stall observed when running an aarch64 guest with virtual smmu
--- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vhost/vhost.c +0
-0drivers/vhost/vhost.c static int vhost_copy_to_user(struct · line 750
Quoted 8 lines
drivers/vhost/vhost.c +1
-1@@ -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);Acked-by Jason Wang <[email protected]>
Quoted 3 lines
Thanks!
Stable material I think.
yes I think so.
Thanks
Eric
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Quoted 19 lines · Eric Auger
vhost_copy_to_useris used to copy vring used elements to userspace. We should useVHOST_ADDR_USEDinstead ofVHOST_ADDR_DESC.Fixes f88949138058 ("vhost: introduce O(1) vq metadata cache")Signed-off-by Eric Auger <[email protected]>---
This fixes a stall observed when running an aarch64 guest with virtual smmu
--- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vhost/vhost.c +0
-0
drivers/vhost/vhost.c static int vhost_copy_to_user(struct vhost_virtqueue *vq, void __user *to, · line 750
Quoted 8 lines
drivers/vhost/vhost.c +1
-1@@ -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);
Thanks!
Stable material I think.
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Quoted 5 lines · Eric Auger
vhost_copy_to_useris used to copy vring used elements to userspace. We should useVHOST_ADDR_USEDinstead ofVHOST_ADDR_DESC.Fixes f88949138058 ("vhost: introduce O(1) vq metadata cache")Signed-off-by Eric Auger <[email protected]>
Quoted 23 lines
---
This fixes a stall observed when running an aarch64 guest with virtual smmu
--- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vhost/vhost.c +1
-1@@ -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);Signature · 1 line
2.5.5