[dpdk-stable] patch 'vhost: add sanity check on inflight last index' has been queued to stable release 20.11.4

Xueming Li xuemingl at nvidia.com
Wed Nov 10 07:31:04 CET 2021


Hi,

FYI, your patch has been queued to stable release 20.11.4

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

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/022ab64a482d3e7a8627446d4acd52cfd084dd7d

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 022ab64a482d3e7a8627446d4acd52cfd084dd7d 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
Cc: Xueming Li <xuemingl at nvidia.com>

[ 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 b97dcf6b69..1a7c240492 100644
--- a/lib/librte_vhost/vhost.c
+++ b/lib/librte_vhost/vhost.c
@@ -1191,6 +1191,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.33.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-10 14:17:09.922847297 +0800
+++ 0180-vhost-add-sanity-check-on-inflight-last-index.patch	2021-11-10 14:17:01.990745109 +0800
@@ -1 +1 @@
-From 5a4fbe79e6d124141bd0a820c897287b15c559c4 Mon Sep 17 00:00:00 2001
+From 022ab64a482d3e7a8627446d4acd52cfd084dd7d Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 5a4fbe79e6d124141bd0a820c897287b15c559c4 ]
@@ -10 +12,0 @@
-Cc: stable at dpdk.org
@@ -15 +17 @@
- lib/vhost/vhost.c | 3 +++
+ lib/librte_vhost/vhost.c | 3 +++
@@ -18,5 +20,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 b97dcf6b69..1a7c240492 100644
+--- a/lib/librte_vhost/vhost.c
++++ b/lib/librte_vhost/vhost.c
+@@ -1191,6 +1191,9 @@ rte_vhost_set_last_inflight_io_split(int vid, uint16_t vring_idx,


More information about the stable mailing list