patch 'vhost: add sanity check on inflight last index' has been queued to stable release 19.11.11

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Nov 30 17:34:57 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before December 10th 2021. 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/27c4b8065e4c15f816d3fcf93b602f3b9e4c7e24

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 27c4b8065e4c15f816d3fcf93b602f3b9e4c7e24 Mon Sep 17 00:00:00 2001
From: Li Feng <fengli at smartx.com>
Date: Thu, 14 Oct 2021 20:40:08 +0800
Subject: [PATCH] vhost: add sanity check on inflight last index

[ upstream commit 5a4fbe79e6d124141bd0a820c897287b15c559c4 ]

The index in rte_vhost_set_last_inflight_io_split is from
the frontend driver, check if it's in the virtqueue range.

Fixes: bb0c2de9602b ("vhost: add APIs to operate inflight ring")

Signed-off-by: Li Feng <fengli at smartx.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 lib/librte_vhost/vhost.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
index b876e81dbd..bb86e02d1e 100644
--- a/lib/librte_vhost/vhost.c
+++ b/lib/librte_vhost/vhost.c
@@ -1174,6 +1174,9 @@ rte_vhost_set_last_inflight_io_split(int vid, uint16_t vring_idx,
 	if (unlikely(!vq->inflight_split))
 		return -1;
 
+	if (unlikely(idx >= vq->size))
+		return -1;
+
 	vq->inflight_split->last_inflight_io = idx;
 	return 0;
 }
-- 
2.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-30 16:50:11.312031076 +0100
+++ 0093-vhost-add-sanity-check-on-inflight-last-index.patch	2021-11-30 16:50:05.890874264 +0100
@@ -1 +1 @@
-From 5a4fbe79e6d124141bd0a820c897287b15c559c4 Mon Sep 17 00:00:00 2001
+From 27c4b8065e4c15f816d3fcf93b602f3b9e4c7e24 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5a4fbe79e6d124141bd0a820c897287b15c559c4 ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -15 +16 @@
- lib/vhost/vhost.c | 3 +++
+ lib/librte_vhost/vhost.c | 3 +++
@@ -18,5 +19,5 @@
-diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
-index 9540522dac..3b674ac320 100644
---- a/lib/vhost/vhost.c
-+++ b/lib/vhost/vhost.c
-@@ -1226,6 +1226,9 @@ rte_vhost_set_last_inflight_io_split(int vid, uint16_t vring_idx,
+diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
+index b876e81dbd..bb86e02d1e 100644
+--- a/lib/librte_vhost/vhost.c
++++ b/lib/librte_vhost/vhost.c
+@@ -1174,6 +1174,9 @@ rte_vhost_set_last_inflight_io_split(int vid, uint16_t vring_idx,


More information about the stable mailing list