From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BA5FEA0524 for ; Thu, 4 Feb 2021 12:37:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AA2D724076E; Thu, 4 Feb 2021 12:37:23 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by mails.dpdk.org (Postfix) with ESMTP id A19DE24075A for ; Thu, 4 Feb 2021 12:37:22 +0100 (CET) Received: from 2.general.paelzer.uk.vpn ([10.172.196.173] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l7cws-0005fH-Fw; Thu, 04 Feb 2021 11:37:22 +0000 From: Christian Ehrhardt To: Gagandeep Singh Cc: Akhil Goyal , dpdk stable Date: Thu, 4 Feb 2021 12:29:12 +0100 Message-Id: <20210204112954.2488123-97-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210204112954.2488123-1-christian.ehrhardt@canonical.com> References: <20210204112954.2488123-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'crypto/dpaa2_sec: fix memory allocation check' has been queued to stable release 19.11.7 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 --- >From 3241c0dce2624ab5055b2bf7d487707ea4ad34c1 Mon Sep 17 00:00:00 2001 From: Gagandeep Singh 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 Acked-by: Akhil Goyal --- 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@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;