[v2,3/5] vhost: fix virtqueue access check in vhost-user setup
Checks
Commit Message
Calling vring_invalidate must be done with a (write) lock taken on the
virtqueue.
Fixes: 72d002b3ebda ("vhost: fix vring address handling during live migration")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
---
Changes since v1:
- moved fix out of patch 3,
---
lib/vhost/vhost_user.c | 2 ++
1 file changed, 2 insertions(+)
Comments
On 12/5/23 10:45, David Marchand wrote:
> Calling vring_invalidate must be done with a (write) lock taken on the
> virtqueue.
>
> Fixes: 72d002b3ebda ("vhost: fix vring address handling during live migration")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> Acked-by: Eelco Chaudron <echaudro@redhat.com>
> ---
> Changes since v1:
> - moved fix out of patch 3,
>
> ---
> lib/vhost/vhost_user.c | 2 ++
> 1 file changed, 2 insertions(+)
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
@@ -2198,7 +2198,9 @@ vhost_user_get_vring_base(struct virtio_net **pdev,
vhost_user_iotlb_flush_all(dev);
+ rte_rwlock_write_lock(&vq->access_lock);
vring_invalidate(dev, vq);
+ rte_rwlock_write_unlock(&vq->access_lock);
return RTE_VHOST_MSG_RESULT_REPLY;
}