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 C7D3EA00C3; Sat, 16 May 2020 11:21:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 288B41D97B; Sat, 16 May 2020 11:21:37 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 39BFC1D97A for ; Sat, 16 May 2020 11:21:35 +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 04G9KxjI015627; Sat, 16 May 2020 02:21:34 -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=OeEpG4PSrn98Cw4tiAoHVqqqR1SVq15svzerG+pk8GiAslnmmZz6gyL4E1YZ/dKj9ZeH J7rSYU5irqGlpi67XXzg5mqEfv/ZVLfBiBMITtLmA90cldaMroStjD4lwyIWtRQkgpuf 3OLWoy2tADpTcWXin0OJfnlbcOJTGbZ70llsY2Zwx6tCeW6RolNinxnPWPKjJfcFHKCb 6R3eHcTLMFRe/FReR60Lw+aC1e8W+DCu/0vzDU4qmKTLUWC63IbDFNElSZ8kO2MwTpua x474xvKkBRwzQx+UY6j+nXK0lH8nRXQlDlB018SRuemtEeV7TpMXectqcmerYxR1M83Q 8g== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 3100xkbqvj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sat, 16 May 2020 02:21:34 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 16 May 2020 02:21:32 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 16 May 2020 02:21:31 -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:21:31 -0700 Received: from ajoseph83.caveonetworks.com (ajoseph83.caveonetworks.com [10.29.45.60]) by maili.marvell.com (Postfix) with ESMTP id C2CF53F7041; Sat, 16 May 2020 02:21:28 -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:50:57 +0530 Message-ID: <1589620862-25258-2-git-send-email-anoobj@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589620862-25258-1-git-send-email-anoobj@marvell.com> References: <1589620862-25258-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