[dpdk-stable] patch 'vhost: validate index in live-migration API' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Nov 9 19:40:31 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

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/11/20. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/215263f3e48e81ea5af88c615fb4f57c4bce5968

Thanks.

Luca Boccassi

---
>From 215263f3e48e81ea5af88c615fb4f57c4bce5968 Mon Sep 17 00:00:00 2001
From: Maxime Coquelin <maxime.coquelin at redhat.com>
Date: Mon, 19 Oct 2020 19:34:12 +0200
Subject: [PATCH] vhost: validate index in live-migration API

[ upstream commit 943daec05c596c03471e3f9432b104eaaa2edf0f ]

This patch validates the queue index parameter, in order
to ensure no out-of-bound accesses happen.

Fixes: bd2e0c3fe5ac ("vhost: add APIs for live migration")

Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia at intel.com>
---
 lib/librte_vhost/vhost.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
index 2d23de598e..2e3dd0e0cf 100644
--- a/lib/librte_vhost/vhost.c
+++ b/lib/librte_vhost/vhost.c
@@ -1449,6 +1449,9 @@ int rte_vhost_get_vring_base(int vid, uint16_t queue_id,
 	if (dev == NULL || last_avail_idx == NULL || last_used_idx == NULL)
 		return -1;
 
+	if (queue_id >= VHOST_MAX_VRING)
+		return -1;
+
 	vq = dev->virtqueue[queue_id];
 	if (!vq)
 		return -1;
@@ -1475,6 +1478,9 @@ int rte_vhost_set_vring_base(int vid, uint16_t queue_id,
 	if (!dev)
 		return -1;
 
+	if (queue_id >= VHOST_MAX_VRING)
+		return -1;
+
 	vq = dev->virtqueue[queue_id];
 	if (!vq)
 		return -1;
-- 
2.27.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-11-09 18:40:12.877292392 +0000
+++ 0043-vhost-validate-index-in-live-migration-API.patch	2020-11-09 18:40:11.167311842 +0000
@@ -1 +1 @@
-From 943daec05c596c03471e3f9432b104eaaa2edf0f Mon Sep 17 00:00:00 2001
+From 215263f3e48e81ea5af88c615fb4f57c4bce5968 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 943daec05c596c03471e3f9432b104eaaa2edf0f ]
+
@@ -10 +11,0 @@
-Cc: stable at dpdk.org
@@ -19 +20 @@
-index 801a1a5098..b9afe46ca2 100644
+index 2d23de598e..2e3dd0e0cf 100644
@@ -22 +23 @@
-@@ -1467,6 +1467,9 @@ int rte_vhost_get_vring_base(int vid, uint16_t queue_id,
+@@ -1449,6 +1449,9 @@ int rte_vhost_get_vring_base(int vid, uint16_t queue_id,
@@ -32 +33 @@
-@@ -1493,6 +1496,9 @@ int rte_vhost_set_vring_base(int vid, uint16_t queue_id,
+@@ -1475,6 +1478,9 @@ int rte_vhost_set_vring_base(int vid, uint16_t queue_id,


More information about the stable mailing list