From patchwork Thu Apr 21 07:58:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gowrishankar Muthukrishnan X-Patchwork-Id: 109961 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B7587A00C3; Thu, 21 Apr 2022 09:58:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9D04410E1; Thu, 21 Apr 2022 09:58:31 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 7148740042 for ; Thu, 21 Apr 2022 09:58:30 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 23KNfWxC009257 for ; Thu, 21 Apr 2022 00:58:29 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=UkRXS9QmNMaojp+x2OKhM0TjXjoutrFRKjLapkYFtlA=; b=Yl2Q/Rc7Ar603I279YVZKaTgKeiKkQHQR6ounoFJTV1S93Q8h+OVmfDYmLqrCzMDNm4W 3+bpSwKuUpHfSE+6rf5r1YODWta0CLrfKIRthyU4MkjeDBZhBKUqWyMRa576NtQKZPx5 xP14a49gbDyPSgKiohYcLoLpCgaAapsDFHl9UFcTTOUOP3dvXMqO+S/3itVakjyNA24Q GXz0nKlIt6WmFMCAeJMlTgn8NvkcRWhAzRErK2fPydiBxseQ1bMLZCgQPN9Ra/rB9NrN u1myS9OcX1AgbJnz+2zE/Vx57yUdS0vf8T2i4shK4KJa3XY6ExNJU/gXVpwhCrxS382w Rg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3fhtaph3b7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 21 Apr 2022 00:58:29 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 21 Apr 2022 00:58:27 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 21 Apr 2022 00:58:27 -0700 Received: from localhost.localdomain (unknown [10.28.34.38]) by maili.marvell.com (Postfix) with ESMTP id 9719A3F705F; Thu, 21 Apr 2022 00:58:25 -0700 (PDT) From: Gowrishankar Muthukrishnan To: CC: Tejasree Kondoj , Ankur Dwivedi , Anoob Joseph , Archana Muniganti , Jerin Jacob , "Gowrishankar Muthukrishnan" Subject: [PATCH] crypto/cnxk: prevent out of bound access in crypto_caps Date: Thu, 21 Apr 2022 13:28:19 +0530 Message-ID: <20220421075819.528987-1-gmuthukrishn@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-GUID: jr7rQnsSyBH6w-qA_Bp8izHgl_PgHQ1g X-Proofpoint-ORIG-GUID: jr7rQnsSyBH6w-qA_Bp8izHgl_PgHQ1g X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-20_06,2022-04-20_01,2022-02-23_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org In a situation where crypto_caps elements are checked only for RTE_CRYPTO_OP_TYPE_UNDEFINED until valid op defined, there is possibility for an out of bound access. Add this array by one element for current capabilities. Signed-off-by: Gowrishankar Muthukrishnan Acked-by: Anoob Joseph --- drivers/crypto/cnxk/cnxk_cryptodev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/cnxk/cnxk_cryptodev.h b/drivers/crypto/cnxk/cnxk_cryptodev.h index 16e757283c..e65195ed66 100644 --- a/drivers/crypto/cnxk/cnxk_cryptodev.h +++ b/drivers/crypto/cnxk/cnxk_cryptodev.h @@ -10,7 +10,7 @@ #include "roc_cpt.h" -#define CNXK_CPT_MAX_CAPS 34 +#define CNXK_CPT_MAX_CAPS 35 #define CNXK_SEC_CRYPTO_MAX_CAPS 11 #define CNXK_SEC_MAX_CAPS 5 #define CNXK_AE_EC_ID_MAX 8