[dpdk-stable] patch 'vhost/crypto: check request pointer before dereference' has been queued to stable release 19.11.10

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Aug 10 17:38:54 CEST 2021


Hi,

FYI, your patch has been queued to stable release 19.11.10

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/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/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/a8400e9443c5265694ef13eb7f8786e4438da4e1

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From a8400e9443c5265694ef13eb7f8786e4438da4e1 Mon Sep 17 00:00:00 2001
From: Thierry Herbelot <thierry.herbelot at 6wind.com>
Date: Mon, 24 May 2021 11:08:21 +0200
Subject: [PATCH] vhost/crypto: check request pointer before dereference

[ upstream commit 9cfbe67691f02e3f66f6a6804a5ce266830e1f3f ]

Use vc_req only after it was checked not to be NULL.

Fixes: 2d962bb736521 ("vhost/crypto: fix possible TOCTOU attack")

Signed-off-by: Thierry Herbelot <thierry.herbelot at 6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 lib/librte_vhost/vhost_crypto.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/librte_vhost/vhost_crypto.c b/lib/librte_vhost/vhost_crypto.c
index e08f9c6d75..0439b12bc7 100644
--- a/lib/librte_vhost/vhost_crypto.c
+++ b/lib/librte_vhost/vhost_crypto.c
@@ -1338,13 +1338,15 @@ vhost_crypto_finalize_one_request(struct rte_crypto_op *op,
 	struct rte_mbuf *m_src = op->sym->m_src;
 	struct rte_mbuf *m_dst = op->sym->m_dst;
 	struct vhost_crypto_data_req *vc_req = rte_mbuf_to_priv(m_src);
-	struct vhost_virtqueue *vq = vc_req->vq;
-	uint16_t used_idx = vc_req->desc_idx, desc_idx;
+	struct vhost_virtqueue *vq;
+	uint16_t used_idx, desc_idx;
 
 	if (unlikely(!vc_req)) {
 		VC_LOG_ERR("Failed to retrieve vc_req");
 		return NULL;
 	}
+	vq = vc_req->vq;
+	used_idx = vc_req->desc_idx;
 
 	if (old_vq && (vq != old_vq))
 		return vq;
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:13.629367131 +0200
+++ 0014-vhost-crypto-check-request-pointer-before-dereferenc.patch	2021-08-10 15:11:12.914637350 +0200
@@ -1 +1 @@
-From 9cfbe67691f02e3f66f6a6804a5ce266830e1f3f Mon Sep 17 00:00:00 2001
+From a8400e9443c5265694ef13eb7f8786e4438da4e1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9cfbe67691f02e3f66f6a6804a5ce266830e1f3f ]
+
@@ -9 +10,0 @@
-Cc: stable at dpdk.org
@@ -14 +15 @@
- lib/vhost/vhost_crypto.c | 6 ++++--
+ lib/librte_vhost/vhost_crypto.c | 6 ++++--
@@ -17,5 +18,5 @@
-diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c
-index 6689c52df2..926b5c0bd9 100644
---- a/lib/vhost/vhost_crypto.c
-+++ b/lib/vhost/vhost_crypto.c
-@@ -1337,13 +1337,15 @@ vhost_crypto_finalize_one_request(struct rte_crypto_op *op,
+diff --git a/lib/librte_vhost/vhost_crypto.c b/lib/librte_vhost/vhost_crypto.c
+index e08f9c6d75..0439b12bc7 100644
+--- a/lib/librte_vhost/vhost_crypto.c
++++ b/lib/librte_vhost/vhost_crypto.c
+@@ -1338,13 +1338,15 @@ vhost_crypto_finalize_one_request(struct rte_crypto_op *op,


More information about the stable mailing list