From: Maxime Coquelin Date: Thu, 24 Mar 2022 12:46:34 +0000 (+0100) Subject: vhost: fix missing virtqueue lock protection X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c5736998305def298e26f8fa73b9995f184fc983;p=dpdk.git vhost: fix missing virtqueue lock protection 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 Reviewed-by: David Marchand --- diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c index cf4bac277a..df0bb9d043 100644 --- a/lib/vhost/vhost.c +++ b/lib/vhost/vhost.c @@ -1291,11 +1291,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; }