patch 'vhost: fix missing virtqueue lock protection' has been queued to stable release 19.11.13

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Thu Jul 7 09:54:14 CEST 2022


Hi,

FYI, your patch has been queued to stable release 19.11.13

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/09/22. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/5189c8ebb88cd88996d52c2d51ec4e2350df5891

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 5189c8ebb88cd88996d52c2d51ec4e2350df5891 Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin at redhat.com>
Date: Thu, 24 Mar 2022 13:46:34 +0100
Subject: [PATCH] vhost: fix missing virtqueue lock protection

[ upstream commit c5736998305def298e26f8fa73b9995f184fc983 ]

This patch ensures virtqueue metadata are not being
modified while rte_vhost_vring_call() is executed.

Fixes: 6c299bb7322f ("vhost: introduce vring call API")

Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Reviewed-by: David Marchand <david.marchand at redhat.com>
---
 lib/librte_vhost/vhost.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
index bb86e02d1e..0b88fc1a49 100644
--- a/lib/librte_vhost/vhost.c
+++ b/lib/librte_vhost/vhost.c
@@ -1248,11 +1248,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.37.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-07-07 09:54:12.010787775 +0200
+++ 0019-vhost-fix-missing-virtqueue-lock-protection.patch	2022-07-07 09:54:10.817823702 +0200
@@ -1 +1 @@
-From c5736998305def298e26f8fa73b9995f184fc983 Mon Sep 17 00:00:00 2001
+From 5189c8ebb88cd88996d52c2d51ec4e2350df5891 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c5736998305def298e26f8fa73b9995f184fc983 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -15 +16 @@
- lib/vhost/vhost.c | 4 ++++
+ lib/librte_vhost/vhost.c | 4 ++++
@@ -18,5 +19,5 @@
-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)
+diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
+index bb86e02d1e..0b88fc1a49 100644
+--- a/lib/librte_vhost/vhost.c
++++ b/lib/librte_vhost/vhost.c
+@@ -1248,11 +1248,15 @@ rte_vhost_vring_call(int vid, uint16_t vring_idx)


More information about the stable mailing list