From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 22C05A00C3; Sat, 16 May 2020 11:27:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 709D71D98E; Sat, 16 May 2020 11:27:22 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id BECA51D98D for ; Sat, 16 May 2020 11:27:21 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04G9QBst020926; Sat, 16 May 2020 02:27:21 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=YxiYAEwVJd2F7GjIiiyZZt6hob1sYddu60FsmpLjCy0=; b=kBXP6fEQznVzvq/JPbRmHnVOzK9+sEHgkoucQBKBjD7fGA19R0H6p7+XeoWbiwZmB9iH N3h0t692xVlblsEo8kMkL7yOvci3LfuWJvBZzfNA3xgEN7vuQgZqwwjCXUKwNUwIFgPg LmA3N/z2KvLHRvnzS8kMJijv1716jw+16cKho7zXheI/EbvBE+zCAimTGDA/0nuZM5mL r/HoyTq4GRmR0HTImh4xbLeR1k9NgeMR9UfunBn4lQnyb3nQ48+jPTlez7RYkD168ON3 jpL/Qn+hrcF5XmQbtT2CMfMSd11Lbp4QvIGIvmZ3e/xyS/v648EsggEuo9e8F4jnZMGw RA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 3100xkbre3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sat, 16 May 2020 02:27:21 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 16 May 2020 02:27:18 -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; Sat, 16 May 2020 02:27:18 -0700 Received: from ajoseph83.caveonetworks.com (ajoseph83.caveonetworks.com [10.29.45.60]) by maili.marvell.com (Postfix) with ESMTP id 41F513F7043; Sat, 16 May 2020 02:27:16 -0700 (PDT) From: Anoob Joseph To: Akhil Goyal CC: Anoob Joseph , Thomas Monjalon , Jerin Jacob , Narayana Prasad , Ankur Dwivedi , Tejasree Kondoj , Date: Sat, 16 May 2020 14:56:53 +0530 Message-ID: <1589621218-25339-2-git-send-email-anoobj@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589621218-25339-1-git-send-email-anoobj@marvell.com> References: <1589621218-25339-1-git-send-email-anoobj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-16_05:2020-05-15, 2020-05-16 signatures=0 Subject: [dpdk-dev] [PATCH 1/6] common/octeontx2: 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" Coverity issue: 354230, 354231 Fixes: f44e71637755 ("net/octeontx2: add security session operations") Fixes: 3fe4d07d1678 ("crypto/octeontx2: enable CPT to share QP with ethdev") Signed-off-by: Anoob Joseph --- drivers/common/octeontx2/otx2_sec_idev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/common/octeontx2/otx2_sec_idev.c b/drivers/common/octeontx2/otx2_sec_idev.c index 4e65ce2..6e9643c 100644 --- a/drivers/common/octeontx2/otx2_sec_idev.c +++ b/drivers/common/octeontx2/otx2_sec_idev.c @@ -55,7 +55,7 @@ otx2_sec_idev_tx_cpt_qp_add(uint16_t port_id, struct otx2_cpt_qp *qp) struct otx2_sec_idev_cfg *cfg; int i, ret; - if (qp == NULL || port_id > OTX2_MAX_INLINE_PORTS) + if (qp == NULL || port_id >= OTX2_MAX_INLINE_PORTS) return -EINVAL; cfg = &sec_cfg[port_id]; @@ -126,7 +126,7 @@ otx2_sec_idev_tx_cpt_qp_get(uint16_t port_id, struct otx2_cpt_qp **qp) uint16_t index; int i, ret; - if (port_id > OTX2_MAX_INLINE_PORTS || qp == NULL) + if (port_id >= OTX2_MAX_INLINE_PORTS || qp == NULL) return -EINVAL; cfg = &sec_cfg[port_id]; -- 2.7.4