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 56BADA00C5; Mon, 11 May 2020 13:09:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DE08C1C225; Mon, 11 May 2020 13:08:50 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 9C2271C238; Mon, 11 May 2020 13:08:48 +0200 (CEST) IronPort-SDR: H2D378gldm7ordBmopnsm3lBHibiqJJMB77tGVQn3L9W4R+VwHrYgDEFL9BPK5CAdQTCSkdWFh dnEk12uU6LkQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2020 04:08:47 -0700 IronPort-SDR: wH8ESJ4vwfsUo5/D7rF/cNOmrjN00g7O2VL6snL/lmGucqWDipCNWMBY8cANgb+4bEty1smI/8 lEh0oNdZ3iTQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,379,1583222400"; d="scan'208";a="297651986" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga008.jf.intel.com with ESMTP; 11 May 2020 04:08:47 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 11 May 2020 04:08:47 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 11 May 2020 04:08:46 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 11 May 2020 04:08:46 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.100) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 11 May 2020 04:08:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XS/khdzqT3EUOtRUXRRShIUyxWYd0LK9vXj66NDEOpxEeUhx0XxffuYLylQj2aQF6aFkPyyT14YFwHaOcMwHvS/GFxarUKlzR7KHFZ+6p7sXHkIiZd+3kwKydGR4KwdEly45n+bGzLj2tLXOMYJmoTxEwPi1tIBhag84VQio7TF0S2crvHcSyEPwmhjNUH6yvxCmhxa2uJjsnZPfqrcb1xBWzz3YfQV6QQzKQmJ8kv3+zuxf+YdTBbYXaQgkVhozkgjbWCutBYr/8sTi3qzB0qvSE9crEotb0iOxsdvZnAUT06LOnPfKS6+pfrAHcBO8jO9MSxff1RDLCrmPy47BeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ejx04biY2gV13xD2aixQDmblF7c1eL7hxWY1lg/zBJc=; b=RRIHZoqnVYGaUK5JvVjjba6EvooGE8J2cb3xsEKDHUiBeGK/mQ1EmyG4ROpqxurT0DaYJKeTN4RSkm/t4QsY4d0siF4UYjoZRG5Apu667iYlpmlQIdCaDvDXp27oADj+0St1OUu42C1uuBXyypJNzNFJc255RCtMoXk5G0cBEhcPKQHOpAWVqp7xM6UCmftvNledLpBEY42f7uq9kQYGqQVRzSKRKVuAoAAgyrWi0bKUr0U9W+26kNnPefq+0FHvYOO+wgt0+wQGUBpuzPStFrF1Zx+qeUnQI88YA2eiWyGPDOq7RX3SoQmohzDx+654UQXaD+JdG0c40NnlIuaz3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ejx04biY2gV13xD2aixQDmblF7c1eL7hxWY1lg/zBJc=; b=SiTFprpmYpHcfvDQuGVBtdQP6yrZISLPGzCuu/OSLNspdTRsKKw/g9t6hI7dGp8Y64lc60eWRkbFQLJfgrnLeDeug4vA2vnSt5EqAkO8L8tzrHZspnGUKWeoM+ZXFuumSNof9b8+N7cdLRwmmq2iR8z+t8vyYqdwXKyihGE0gMc= Received: from BYAPR11MB3301.namprd11.prod.outlook.com (2603:10b6:a03:7f::26) by BYAPR11MB2760.namprd11.prod.outlook.com (2603:10b6:a02:c0::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.33; Mon, 11 May 2020 11:08:43 +0000 Received: from BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f8cb:58cd:e958:fff4]) by BYAPR11MB3301.namprd11.prod.outlook.com ([fe80::f8cb:58cd:e958:fff4%6]) with mapi id 15.20.2979.033; Mon, 11 May 2020 11:08:43 +0000 From: "Ananyev, Konstantin" To: "Medvedkin, Vladimir" , "dev@dpdk.org" CC: "akhil.goyal@nxp.com" , "stable@dpdk.org" Thread-Topic: [PATCH] ipsec: fix unchecked return value Thread-Index: AQHWJ3Xehr3mtxzun0ye5KJ8WCceeKiiuflQ Date: Mon, 11 May 2020 11:08:42 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.151.178] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ed5e563c-0e3f-4970-af41-08d7f59baaca x-ms-traffictypediagnostic: BYAPR11MB2760: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:147; x-forefront-prvs: 04004D94E2 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ExBDHaapI0rrnfqg9LU7YXxQVF5IcX28qrvI+zB+T5E3rZ45AMv+2HMRZ4C4LVveun3AAmwUbdm8lg43b+Q6bsB6joEswHbiX0J6yGX2CKlUSsWa5F2lNlYoCIIP34DrvP+Q5UDll6CrU+Jnb4ZwAr7PgZA2moqeN8/DUFe5gCMEWkHwD0T5HtyVTBLWaPVFp6fvfefQo21xAjI2ZXLz7Fex0kdDMIxXeemRoRuaIWDBQU+VF6UPkvils+rGV1570Oo8Vc3Gng8s7FFnhYyt6nD6GKF9dV7Vw+BJ3CeQlk7X89UIrBXzW8dZk6o3PKB0C0A6cy+3Cx26SgKCcwpJb5LuowBYhzQKOKD9Bv3A/9Qg3Lv7aqp/s58Tu/dZCwxQi2UF0Gq5DndbFXkfEoRI0vpy4oQVDWUt7u17S47Bzwm3WuJeH9BmjzVaY0jP+CYbJeKw00q0jL9ztE9Xi4pIBuVHBeZ5Eai/hHj1k2dyN+UTRIgx1NqwlnTanUZ2nnMCaMTiE0Xr3Mu/ZhcM6U6nBw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3301.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(39860400002)(376002)(396003)(136003)(346002)(366004)(33430700001)(7696005)(33440700001)(9686003)(55016002)(4744005)(71200400001)(33656002)(5660300002)(4326008)(86362001)(478600001)(8936002)(2906002)(8676002)(66446008)(52536014)(76116006)(64756008)(6506007)(66476007)(66556008)(66946007)(186003)(26005)(110136005)(54906003)(316002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: a1EOEF/07DvWrtI6RYqhhG/Z8tBMl/fkWEESMAofqhb43GymrPJYYV6hPP+/UySu/xmdoSFTsCY4dop95kkDLr/m3PbAaU+qRU8WdtprRjuOcXtdhtXhW3ZXRJbK0cLMSFMcxK8BmIGP1YDPv6UCUXS5wy5ETb9ctbI/lUQrGGbP6xWFxPAvIu495tbHK7ToWBXT9XX1neHgpyx5z2ckRa6DFl+IoMQM4A98wA2O7DigE+/gPVFLyZP47eC/S/0cAFV9h0OZfsGqtBtp+jxJBaYrUEVDzam0UbiJuMnSDfraoNK8HmWpNQBus971R27IKTCLfcIf27ooNgAIUeWWBEZ6vs3ZZr9jdE2A/AblaZ8oacWGzkbBLEBX+eHEaFgcLOcDLGw1cejIRwtk3PLon3TPh5eHJ6+712JJRgCVNLfhvASSAeHMeBCUq1eYnl5F2a++xxql3lxBrmCdG+ZBT+ugRn++pn3qu1NmWD/BsJZaXU+aOuwZdYINvOpZ4m4D Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ed5e563c-0e3f-4970-af41-08d7f59baaca X-MS-Exchange-CrossTenant-originalarrivaltime: 11 May 2020 11:08:42.8321 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gjYs3UvmQwjp5ovY1tG5L+QQpZ9Y663X0awZWO/iIiBzUAQjoqZ0Rq1ueZyprEJgNq6+3PGOSools4XuZ9Wcqlx0mAcScgKcdZq3CdoeBiA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2760 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] ipsec: fix unchecked return value 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" > Explicitly check return value in add_specific() > CID 357760 (#2 of 2): Negative array index write (NEGATIVE_RETURNS) > 8. negative_returns: Using variable ret as an index to array sad->cnt_arr >=20 > Fixes: b2ee26926775 ("ipsec: add SAD add/delete/lookup implementation") > Cc: stable@dpdk.org >=20 > Signed-off-by: Vladimir Medvedkin > --- > lib/librte_ipsec/ipsec_sad.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/lib/librte_ipsec/ipsec_sad.c b/lib/librte_ipsec/ipsec_sad.c > index 6c95240..3f9533c 100644 > --- a/lib/librte_ipsec/ipsec_sad.c > +++ b/lib/librte_ipsec/ipsec_sad.c > @@ -104,6 +104,8 @@ add_specific(struct rte_ipsec_sad *sad, const void *k= ey, > ret =3D rte_hash_lookup_with_hash(sad->hash[RTE_IPSEC_SAD_SPI_ONLY], ke= y, > rte_hash_crc(key, sad->keysize[RTE_IPSEC_SAD_SPI_ONLY], > sad->init_val)); > + if (ret < 0) > + return ret; > if (key_type =3D=3D RTE_IPSEC_SAD_SPI_DIP) > sad->cnt_arr[ret].cnt_dip +=3D notexist; > else > -- Acked-by: Konstantin Ananyev > 2.7.4