From patchwork Wed Feb 9 11:52:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Fialko X-Patchwork-Id: 107125 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 3E711A04A6; Wed, 9 Feb 2022 12:52:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D503341143; Wed, 9 Feb 2022 12:52:25 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 5C65D40140 for ; Wed, 9 Feb 2022 12:52:24 +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 21991fwA014382; Wed, 9 Feb 2022 03:52:23 -0800 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=bSSFfAcaYagevoPPvCIJZHABB1YfVvU0C7hg1xuh+wg=; b=ZpRR19oDdELtuuV7d9e+hXWsSUgDhB3TSlkVHRax6b6ApVcKYeh6yipsO/zClttpbq2o w8p3IWbXBCLhoTXPMNeMHCRJPxRkysL4EjQY2gm8+BT2PIE/uFEDHht2M8H1xwhlB1N9 UCemvR/bge1Rn0DpTOgE5tHs7egYzUIPxt+cXVpx1ySkbdsjHD5qxU+5nuB4ji7toB14 hj2LiM+pcypxqnrMU4efUpft4LObm4wq5dxo5YnZJmIbkCty5GYXOgkvds5SU+7O7FGO U8+Q0t0WeDvOFbtSCKE/D3dZDSTlr/0lofeJjGmgVrsBWg+EM7eC0bWFtTxSNhEfhi3u Fw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3e4am90k4r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 09 Feb 2022 03:52:23 -0800 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; Wed, 9 Feb 2022 03:52:21 -0800 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; Wed, 9 Feb 2022 03:52:21 -0800 Received: from localhost.localdomain (unknown [10.28.34.39]) by maili.marvell.com (Postfix) with ESMTP id 4C0223F7091; Wed, 9 Feb 2022 03:52:19 -0800 (PST) From: Volodymyr Fialko To: , Radu Nicolau , Akhil Goyal CC: , , Volodymyr Fialko Subject: [PATCH] examples/ipsec-secgw: add check for unprotected port mask Date: Wed, 9 Feb 2022 12:52:13 +0100 Message-ID: <20220209115213.3918784-1-vfialko@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-GUID: zWYg2pHUypbc5Nfq85QBlzMhrPS7jCd_ X-Proofpoint-ORIG-GUID: zWYg2pHUypbc5Nfq85QBlzMhrPS7jCd_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-02-09_06,2022-02-09_01,2021-12-02_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 Usage of unprotected port mask without any configured SA inbound, will cause use of uninitialized SA context, so disallow such configuration. Signed-off-by: Volodymyr Fialko Acked-by: Anoob Joseph --- examples/ipsec-secgw/ipsec-secgw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index a643eb3aa7..602e170c96 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -3321,6 +3321,9 @@ main(int32_t argc, char **argv) rte_exit(EXIT_FAILURE, "Invalid unprotected portmask 0x%x\n", unprotected_port_mask); + if (unprotected_port_mask && !nb_sa_in) + rte_exit(EXIT_FAILURE, "Cannot use unprotected portmask without configured SA inbound\n"); + if (check_poll_mode_params(eh_conf) < 0) rte_exit(EXIT_FAILURE, "check_poll_mode_params failed\n");