patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 22.11] vhost: fix virtqueue access check in vhost-user setup
@ 2024-03-07  8:06 David Marchand
  2024-03-07 12:45 ` Luca Boccassi
  0 siblings, 1 reply; 2+ messages in thread
From: David Marchand @ 2024-03-07  8:06 UTC (permalink / raw)
  To: stable; +Cc: luca.boccassi, Eelco Chaudron, Maxime Coquelin

[ upstream commit b3e42d92362bcc75df21c5b86ba7c0685b40a3bf ]

Calling vring_invalidate must be done with a (write) lock taken on the
virtqueue.

Fixes: 72d002b3ebda ("vhost: fix vring address handling during live migration")

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/vhost/vhost_user.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
index 8df66e68b3..66ab68fa56 100644
--- a/lib/vhost/vhost_user.c
+++ b/lib/vhost/vhost_user.c
@@ -2144,7 +2144,9 @@ vhost_user_get_vring_base(struct virtio_net **pdev,
 
 	vhost_user_iotlb_flush_all(vq);
 
+	rte_spinlock_lock(&vq->access_lock);
 	vring_invalidate(dev, vq);
+	rte_spinlock_unlock(&vq->access_lock);
 
 	return RTE_VHOST_MSG_RESULT_REPLY;
 }
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-07 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-07  8:06 [PATCH 22.11] vhost: fix virtqueue access check in vhost-user setup David Marchand
2024-03-07 12:45 ` Luca Boccassi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).