* [PATCH 1/5] vhost: fix missing virtqueue lock protection
[not found] <20220127145655.558029-1-maxime.coquelin@redhat.com>
@ 2022-01-27 14:56 ` Maxime Coquelin
0 siblings, 0 replies; only message in thread
From: Maxime Coquelin @ 2022-01-27 14:56 UTC (permalink / raw)
To: dev, chenbo.xia, david.marchand; +Cc: Maxime Coquelin, stable
This patch ensures virtqueue metadata are not being
modified while rte_vhost_vring_call() is executed.
Fixes: 6c299bb7322f ("vhost: introduce vring call API")
Cc: stable@dpdk.org
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
lib/vhost/vhost.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
index f59ca6c157..42c01abf25 100644
--- a/lib/vhost/vhost.c
+++ b/lib/vhost/vhost.c
@@ -1294,11 +1294,15 @@ rte_vhost_vring_call(int vid, uint16_t vring_idx)
if (!vq)
return -1;
+ rte_spinlock_lock(&vq->access_lock);
+
if (vq_is_packed(dev))
vhost_vring_call_packed(dev, vq);
else
vhost_vring_call_split(dev, vq);
+ rte_spinlock_unlock(&vq->access_lock);
+
return 0;
}
--
2.34.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-27 14:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20220127145655.558029-1-maxime.coquelin@redhat.com>
2022-01-27 14:56 ` [PATCH 1/5] vhost: fix missing virtqueue lock protection Maxime Coquelin
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).