Skip to content

Commit

Permalink
vhost: fix virtqueue access check in vhost-user setup
Browse files Browse the repository at this point in the history
Calling vring_invalidate must be done with a (write) lock taken on the
virtqueue.

Fixes: 72d002b ("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>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
  • Loading branch information
david-marchand authored and mcoquelin committed Feb 6, 2024
1 parent af53286 commit b3e42d9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/vhost/vhost_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b3e42d9

Please sign in to comment.