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 4C2DFA00C3; Fri, 25 Mar 2022 12:29:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2585340687; Fri, 25 Mar 2022 12:29:59 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id BBE3740140 for ; Fri, 25 Mar 2022 12:29:57 +0100 (CET) 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 22P45UtL005718; Fri, 25 Mar 2022 04:29:57 -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=S5Khp8/O4UaA75KZ/VjE0hhpKFzoGO7HND6oid8L1Jg=; b=XdjXJN/sM8E4jhB6RqhiykGVN28bgRSGWGFTEhs6hyX5kXWXixIsX/l4f0Io7Ovwp+Sg bNxH49ChWvDOaInF/IWkD2L99p21vgM36inZC74WT918ftLvRbHVmdDpTUy8zv1pgat6 Y/Yf1Y7kdtzy7LtcjrzKv52IbeALTkuTs3ydzNz+kjcOzloZOkzZDeUkLZdBG3b0ZhRm DDWjNw4P6TAi21fJqBjnb93OUFqJPf681dyfneYEaDUpTesTYt0++SMGVj0IXspvdwxO XWvEOn+qNVSCr85z3s/W5PVCNRtEx3jy8JvNqPmiBU9p178f60uK+n20PnbFMNfz94Gd lw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3eystf50kg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 25 Mar 2022 04:29:57 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 25 Mar 2022 04:29:55 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Fri, 25 Mar 2022 04:29:55 -0700 Received: from localhost.localdomain (unknown [10.28.34.39]) by maili.marvell.com (Postfix) with ESMTP id 67A263F704C; Fri, 25 Mar 2022 04:29:53 -0700 (PDT) From: Volodymyr Fialko To: , Radu Nicolau , Akhil Goyal CC: , Volodymyr Fialko Subject: [PATCH] examples/ipsec-secgw: fix uninitialized memory access Date: Fri, 25 Mar 2022 12:29:42 +0100 Message-ID: <20220325112942.1119663-1-vfialko@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: KqdZS8ma7JQUfFCCsolb_x8tDUL2O5rY X-Proofpoint-GUID: KqdZS8ma7JQUfFCCsolb_x8tDUL2O5rY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-25_02,2022-03-24_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 rte_flow_validate and rte_flow_create not always initialize flow error. Using error.message in some error cases will cause read from uninitialized memory. Fixes: 6738c0a9569 ("examples/ipsec-secgw: support flow director") Signed-off-by: Volodymyr Fialko --- examples/ipsec-secgw/flow.c | 2 +- examples/ipsec-secgw/ipsec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ipsec-secgw/flow.c b/examples/ipsec-secgw/flow.c index 1a1ec7861c..c217b9e475 100644 --- a/examples/ipsec-secgw/flow.c +++ b/examples/ipsec-secgw/flow.c @@ -214,7 +214,7 @@ flow_init_single(struct flow_rule_entry *rule) struct rte_flow_item pattern[MAX_RTE_FLOW_PATTERN] = {}; struct rte_flow_action action[MAX_RTE_FLOW_ACTIONS] = {}; struct rte_flow_attr attr = {}; - struct rte_flow_error err; + struct rte_flow_error err = {}; int ret; attr.egress = 0; diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c index 2d4a26c962..b66ff2b650 100644 --- a/examples/ipsec-secgw/ipsec.c +++ b/examples/ipsec-secgw/ipsec.c @@ -496,7 +496,7 @@ int create_ipsec_esp_flow(struct ipsec_sa *sa) { int ret = 0; - struct rte_flow_error err; + struct rte_flow_error err = {}; if (sa->direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) { RTE_LOG(ERR, IPSEC, "No Flow director rule for Egress traffic\n"); -- 2.25.1