From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 8A9925B1C for ; Wed, 15 May 2019 17:37:20 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2019 08:37:19 -0700 X-ExtLoop1: 1 Received: from silpixa00398673.ir.intel.com (HELO silpixa00398673.ger.corp.intel.com) ([10.237.223.136]) by orsmga008.jf.intel.com with ESMTP; 15 May 2019 08:37:18 -0700 From: Fan Zhang To: dev@dpdk.org Cc: akhil.goyal@nxp.com, Fan Zhang Date: Wed, 15 May 2019 16:32:59 +0100 Message-Id: <20190515153259.74322-1-roy.fan.zhang@intel.com> X-Mailer: git-send-email 2.14.5 Subject: [dpdk-dev] [PATCH] aesni_mb: fix out-of-bounds access X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 May 2019 15:37:21 -0000 This patch fixes the out-of-bounds coverity issue by adding missed algorithms to the array. Coverity issue: 337683 Fixes: c68d7aa354f6 ("crypto/aesni_mb: use architecture independent macros") Signed-off-by: Fan Zhang --- drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h index 4d439360f..c937b21b6 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h @@ -65,7 +65,13 @@ static const unsigned auth_truncated_digest_byte_lengths[] = { [AES_XCBC] = 12, [AES_CMAC] = 12, [AES_CCM] = 8, - [NULL_HASH] = 0 + [NULL_HASH] = 0, + [AES_GMAC] = 12, + [PLAIN_SHA1] = 20, + [PLAIN_SHA_224] = 28, + [PLAIN_SHA_256] = 32, + [PLAIN_SHA_384] = 48, + [PLAIN_SHA_512] = 64 }; /** -- 2.14.5 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 4BD6CA00E6 for ; Wed, 15 May 2019 17:37:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C4F775B1E; Wed, 15 May 2019 17:37:21 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 8A9925B1C for ; Wed, 15 May 2019 17:37:20 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2019 08:37:19 -0700 X-ExtLoop1: 1 Received: from silpixa00398673.ir.intel.com (HELO silpixa00398673.ger.corp.intel.com) ([10.237.223.136]) by orsmga008.jf.intel.com with ESMTP; 15 May 2019 08:37:18 -0700 From: Fan Zhang To: dev@dpdk.org Cc: akhil.goyal@nxp.com, Fan Zhang Date: Wed, 15 May 2019 16:32:59 +0100 Message-Id: <20190515153259.74322-1-roy.fan.zhang@intel.com> X-Mailer: git-send-email 2.14.5 Subject: [dpdk-dev] [PATCH] aesni_mb: fix out-of-bounds access X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190515153259.DucozvJf0e2PZ2NohDjTytiKl-KmxVf-IwnxRO6c0-o@z> This patch fixes the out-of-bounds coverity issue by adding missed algorithms to the array. Coverity issue: 337683 Fixes: c68d7aa354f6 ("crypto/aesni_mb: use architecture independent macros") Signed-off-by: Fan Zhang --- drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h index 4d439360f..c937b21b6 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h @@ -65,7 +65,13 @@ static const unsigned auth_truncated_digest_byte_lengths[] = { [AES_XCBC] = 12, [AES_CMAC] = 12, [AES_CCM] = 8, - [NULL_HASH] = 0 + [NULL_HASH] = 0, + [AES_GMAC] = 12, + [PLAIN_SHA1] = 20, + [PLAIN_SHA_224] = 28, + [PLAIN_SHA_256] = 32, + [PLAIN_SHA_384] = 48, + [PLAIN_SHA_512] = 64 }; /** -- 2.14.5