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

Kevin Traynor ktraynor at redhat.com
Wed May 25 18:28:02 CEST 2022


Hi,

FYI, your patch has been queued to stable release 21.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/30/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/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/78414da84eb5f5ae3594a073bdc978d3e14efeb4

Thanks.

Kevin

---
>From 78414da84eb5f5ae3594a073bdc978d3e14efeb4 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/vhost/vhost.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
index 13a9bb9dd1..474645b64e 100644
--- a/lib/vhost/vhost.c
+++ b/lib/vhost/vhost.c
@@ -1300,4 +1300,6 @@ rte_vhost_vring_call(int vid, uint16_t vring_idx)
 		return -1;
 
+	rte_spinlock_lock(&vq->access_lock);
+
 	if (vq_is_packed(dev))
 		vhost_vring_call_packed(dev, vq);
@@ -1305,4 +1307,6 @@ rte_vhost_vring_call(int vid, uint16_t vring_idx)
 		vhost_vring_call_split(dev, vq);
 
+	rte_spinlock_unlock(&vq->access_lock);
+
 	return 0;
 }
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-05-25 17:26:58.867269545 +0100
+++ 0010-vhost-fix-missing-virtqueue-lock-protection.patch	2022-05-25 17:26:58.544828298 +0100
@@ -1 +1 @@
-From c5736998305def298e26f8fa73b9995f184fc983 Mon Sep 17 00:00:00 2001
+From 78414da84eb5f5ae3594a073bdc978d3e14efeb4 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit c5736998305def298e26f8fa73b9995f184fc983 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
-index cf4bac277a..df0bb9d043 100644
+index 13a9bb9dd1..474645b64e 100644
@@ -22 +23 @@
-@@ -1292,4 +1292,6 @@ rte_vhost_vring_call(int vid, uint16_t vring_idx)
+@@ -1300,4 +1300,6 @@ rte_vhost_vring_call(int vid, uint16_t vring_idx)
@@ -29 +30 @@
-@@ -1297,4 +1299,6 @@ rte_vhost_vring_call(int vid, uint16_t vring_idx)
+@@ -1305,4 +1307,6 @@ rte_vhost_vring_call(int vid, uint16_t vring_idx)



More information about the stable mailing list