patch 'net/virtio-user: fix control queue allocation for non-vDPA' has been queued to stable release 23.11.2

Xueming Li xuemingl at nvidia.com
Mon Aug 12 14:48:12 CEST 2024


Hi,

FYI, your patch has been queued to stable release 23.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 08/14/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ea90bc49fc49710b0a1eea6f7abd237d677f134b

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From ea90bc49fc49710b0a1eea6f7abd237d677f134b Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin at redhat.com>
Date: Wed, 3 Jul 2024 17:59:29 +0200
Subject: [PATCH] net/virtio-user: fix control queue allocation for non-vDPA
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 8b04c3e52344bebf31858066204712d73fd86a75 ]

For non-vDPA backends, where the backend does not support
control queue, it is still emulated in the Virtio-user
layer to handle multiqueue feature. The frontend setups a
control queue, which is hidden to the device. It means the
number of vrings metadata to allocate should be based on
the frontend features and not the device features.

This patch fixes out-of-range access reported by ASan,
which could sometimes be noticed at exit time by a
segmentation fault when disabled:

Fixes: b80947743f5e ("net/virtio-user: fix control queue allocation")

Reported-by: David Marchand <david.marchand at redhat.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Reviewed-by: David Marchand <david.marchand at redhat.com>
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 209435a865..1bfd6aba80 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -609,7 +609,7 @@ virtio_user_alloc_vrings(struct virtio_user_dev *dev)
 	bool packed_ring = !!(dev->device_features & (1ull << VIRTIO_F_RING_PACKED));
 
 	nr_vrings = dev->max_queue_pairs * 2;
-	if (dev->device_features & (1ull << VIRTIO_NET_F_CTRL_VQ))
+	if (dev->frontend_features & (1ull << VIRTIO_NET_F_CTRL_VQ))
 		nr_vrings++;
 
 	dev->callfds = rte_zmalloc("virtio_user_dev", nr_vrings * sizeof(*dev->callfds), 0);
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-08-12 20:44:03.112658452 +0800
+++ 0015-net-virtio-user-fix-control-queue-allocation-for-non.patch	2024-08-12 20:44:01.905069257 +0800
@@ -1 +1 @@
-From 8b04c3e52344bebf31858066204712d73fd86a75 Mon Sep 17 00:00:00 2001
+From ea90bc49fc49710b0a1eea6f7abd237d677f134b Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 8b04c3e52344bebf31858066204712d73fd86a75 ]
@@ -18 +20,0 @@
-Cc: stable at dpdk.org
@@ -28 +30 @@
-index b2c6c2b7df..fed66d2ae9 100644
+index 209435a865..1bfd6aba80 100644
@@ -31 +33 @@
-@@ -624,7 +624,7 @@ virtio_user_alloc_vrings(struct virtio_user_dev *dev)
+@@ -609,7 +609,7 @@ virtio_user_alloc_vrings(struct virtio_user_dev *dev)


More information about the stable mailing list