[dpdk-stable] patch 'crypto/dpaa2_sec: fix memory allocation check' has been queued to stable release 19.11.7

Christian Ehrhardt christian.ehrhardt at canonical.com
Thu Feb 4 12:29:12 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.11.7

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

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 3241c0dce2624ab5055b2bf7d487707ea4ad34c1 Mon Sep 17 00:00:00 2001
From: Gagandeep Singh <g.singh at nxp.com>
Date: Mon, 25 Jan 2021 16:15:34 +0800
Subject: [PATCH] crypto/dpaa2_sec: fix memory allocation check

[ upstream commit 9a494a3b90aad48f5f3f4ced14104f3347723c1b ]

When key length is 0, zmalloc will return NULL pointer
and in that case it should not return NOMEM.
So in this patch, adding a check on key length.

Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")

Signed-off-by: Gagandeep Singh <g.singh at nxp.com>
Acked-by: Akhil Goyal <akhil.goyal at nxp.com>
---
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 5eb78eca57..8df915e610 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -1847,7 +1847,7 @@ dpaa2_sec_cipher_init(struct rte_cryptodev *dev,
 	session->ctxt_type = DPAA2_SEC_CIPHER;
 	session->cipher_key.data = rte_zmalloc(NULL, xform->cipher.key.length,
 			RTE_CACHE_LINE_SIZE);
-	if (session->cipher_key.data == NULL) {
+	if (session->cipher_key.data == NULL && xform->cipher.key.length > 0) {
 		DPAA2_SEC_ERR("No Memory for cipher key");
 		rte_free(priv);
 		return -1;
-- 
2.30.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-02-04 12:04:32.031373203 +0100
+++ 0097-crypto-dpaa2_sec-fix-memory-allocation-check.patch	2021-02-04 12:04:28.106789802 +0100
@@ -1 +1 @@
-From 9a494a3b90aad48f5f3f4ced14104f3347723c1b Mon Sep 17 00:00:00 2001
+From 3241c0dce2624ab5055b2bf7d487707ea4ad34c1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9a494a3b90aad48f5f3f4ced14104f3347723c1b ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index cab79db3dc..05b194ccff 100644
+index 5eb78eca57..8df915e610 100644
@@ -23 +24 @@
-@@ -1842,7 +1842,7 @@ dpaa2_sec_cipher_init(struct rte_cryptodev *dev,
+@@ -1847,7 +1847,7 @@ dpaa2_sec_cipher_init(struct rte_cryptodev *dev,
@@ -31 +32 @@
- 		return -ENOMEM;
+ 		return -1;


More information about the stable mailing list