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 B9393A0555; Wed, 19 Feb 2020 15:02:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BF1861B13C; Wed, 19 Feb 2020 15:02:24 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 4C63A3B5 for ; Wed, 19 Feb 2020 15:02:23 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Feb 2020 06:02:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,459,1574150400"; d="scan'208";a="239697347" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by orsmga006.jf.intel.com with ESMTP; 19 Feb 2020 06:02:21 -0800 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 19 Feb 2020 06:02:21 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 19 Feb 2020 06:02:21 -0800 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 19 Feb 2020 06:02:21 -0800 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.57) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 19 Feb 2020 06:02:18 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z4+xZTno+/fyi355Hjdwcu99xYMNTMBcqkxBn7+YbZcOHsw5duBtjLaArB2ksq7gx5vgp6W7jYoL/zwWj/IbTKTsmgqJhffTSqaYoTDToerUFMrNV6HOv9c/B+yH3zV3CF1jcd2L+24vpcv0z29JMEiNCONRkcn6DnBdCY32OXkJfNW3lS5z3HXduXgMc8QTlQkr+/aupU1QAFLsHbQ7vAVVfe8SWjXcTDbc7rY+0I9QSMx1ULZsZfvwIFHUKuWTWE8gfd7LU/VDM5GlGHLAN2sP2rxLzzBDxlNx/mK7GXBmAbe7BpQvJ4/+15EgcyCWky9vYGTuLcnl4oHMGy0Lpg== 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=/Jyf+MJvA/pVF0aOVhsRNyUOu2h46YH0m3CqzW1RVdI=; b=jdVRb6Yjw1biRU3FdCzkUlZuhOcD/xyzUkcP3WaF3nwCW1ck/36C18d88U1V+FSsVpOYcRbzVtzHPy5Bh5rUpf1TsZqShfswbIMzvPT+7ymBDQdkay3HUhl1AoQWpJa9ryE00kDM/eFbQh3vKFn8h2UeBXJZITf9INdeQJXVOs9zv6leL2RkrJzvOmk7qJ4w51OUNP76ZT1g/RgB0soiIRQkGu/BdeD5UUWIOYOz1Hib2AbKV9hjntrlY3XGOScPbCZPRj1vwXE0eeYtj3RfvlrjaYc5uqAj3eS2fXFJFkL1RBIYY9yFW0Qx2Y+wGZdgYvV/C6ZNFVU7p09jVJ/1tg== 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=/Jyf+MJvA/pVF0aOVhsRNyUOu2h46YH0m3CqzW1RVdI=; b=eUUWBZaYH7tFVsKPtwu5+UBM3rDBHbLetyr97lgUHr2AamaZ65ZEsGKhkVQuEywNRTxSwrVCVtacNgnW+0e0vKB7TkcrzXAGsqf2059ttLzOmq8yqhIZ1p2uDKKOisqVMJNfhBuZevsO0qQ1ynxdf8v746u/mXuomDg7hAy2ojY= Received: from DM6PR11MB3914.namprd11.prod.outlook.com (20.176.126.24) by DM6PR11MB2937.namprd11.prod.outlook.com (20.177.216.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2729.31; Wed, 19 Feb 2020 14:02:15 +0000 Received: from DM6PR11MB3914.namprd11.prod.outlook.com ([fe80::e18c:c44e:cd8a:91ee]) by DM6PR11MB3914.namprd11.prod.outlook.com ([fe80::e18c:c44e:cd8a:91ee%3]) with mapi id 15.20.2729.032; Wed, 19 Feb 2020 14:02:15 +0000 From: "Iremonger, Bernard" To: "Yigit, Ferruh" , "Lu, Wenzhuo" , "Wu, Jingjing" , "Lipiec, Herakliusz" , "Govindharajan, Hariprasad" , "Burakov, Anatoly" CC: "dev@dpdk.org" Thread-Topic: [PATCH] app/testpmd: guarantee that array access is in range Thread-Index: AQHV5yHQR34cH2JQJEClE89CfyYeiKgii+BA Date: Wed, 19 Feb 2020 14:02:14 +0000 Message-ID: References: <20200219124003.1025267-1-ferruh.yigit@intel.com> In-Reply-To: <20200219124003.1025267-1-ferruh.yigit@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYmVhMzNkMmMtNmJiZC00MTMyLWE3YWMtNzEzYTZkMWQ4NzEyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUUxWTmE1bWdDVytPV05CSGtIaVBaZVlmcURUa2wrOUxySU41TzJhOWxreTN1NUUzOXQ5eSsrSnc1bFVCR2FcL0wifQ== dlp-product: dlpe-windows x-ctpclassification: CTP_NT dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=bernard.iremonger@intel.com; x-originating-ip: [192.198.151.179] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b9ff33bf-c8ee-45e9-e10d-08d7b5445315 x-ms-traffictypediagnostic: DM6PR11MB2937: 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:7219; x-forefront-prvs: 0318501FAE x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(396003)(136003)(346002)(376002)(39860400002)(189003)(199004)(26005)(53546011)(6506007)(7696005)(186003)(478600001)(8936002)(110136005)(2906002)(316002)(81156014)(8676002)(9686003)(55016002)(81166006)(76116006)(66476007)(33656002)(6636002)(52536014)(4326008)(66446008)(66556008)(86362001)(64756008)(66946007)(5660300002)(71200400001)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR11MB2937; H:DM6PR11MB3914.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: XGEFPZz/2XeLa41w9gMlZ2VtHxA+FLcfBNW6h5XP7DBNxJF0199LmYEtG15ppufbkW3yOycds/n+pSVfFwPm5LaWli3li86b+qWaX8fvBMocFHMwd1/yCC180x6BeXz89fBAoPz0USTY4k3DAdz6K1XRC5597VTOS86uqZ0raPYOxnnxCy16T4xYWHP3SD+8M/ys90HFvG4fG3NlOG5Ju+nN/0+VWBCPxW3hsqZO9btOYwH+VxVsYim1HuucU+DcsgR+7C1nDicoSW9MsS4aagIZflzUI/aPsOTERoXlL8XtnX/i/7+pRLoXuR+Lw/G6EBpj5J209qt6sGQEF1NTM/4+pthdyWnqF1aEdao9/FWrwtxvNwWldpRfB2/dm10X4kgjbyH4wf1V7st3cS49LH9V6Ca3KQbous7Zst3Q+2bdtFILVhS+J84XTYDdwTbdpJP0KhDxK5deQIn8+YbFPF7+FYjXdzm2Qf3bYI9YmAxSGHGnuU2QW4QVH94y1gi9 x-ms-exchange-antispam-messagedata: X6WTAdfYpz4P+WvtISAkz4eBQOLNsZEPa3H6AAZdOySW9kSAt0StTtjrfBFj9jZB4fN3rfsH8KTjbXaDzu0xfpZWWKpLAqRutVLObv7OsSlu5nKnCfCBe9SbXsKWDtFjSJG0sOuSOMSzEd/CJsP7ow== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b9ff33bf-c8ee-45e9-e10d-08d7b5445315 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Feb 2020 14:02:15.0552 (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: 0QQM++EjvtAshN3hBPvpVampU9g4rp+pRfQMLaxwdPVM7q19TQBEJU5VYmQ04ni/sVgczynjJJDtGDmvRV826MJ0EUcWwtmAokU5ItqMpbQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB2937 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] app/testpmd: guarantee that array access is in range 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" > -----Original Message----- > From: Yigit, Ferruh > Sent: Wednesday, February 19, 2020 12:40 PM > To: Lu, Wenzhuo ; Wu, Jingjing > ; Iremonger, Bernard > ; Lipiec, Herakliusz > ; Govindharajan, Hariprasad > ; Burakov, Anatoly > > Cc: dev@dpdk.org; Yigit, Ferruh > Subject: [PATCH] app/testpmd: guarantee that array access is in range >=20 > Coverity complains about out of bound access, which is a false positive. >=20 > The return value of the 'parse_port_list()' can't be bigger than 'maxsize= ' > because of the logic in the function. ('value >=3D (int)maxsize' > check and 'marked[]' usage.) >=20 > But this is not explicitly clear, causing coverity warning and same quest= ion can > be rise by reviews later. >=20 > Adding a redundant check to highlight the access is in range, this is don= e by > replacing existing redundant check. >=20 > This is also good to protect against out out bound access in case > 'parse_port_list()' behaviour changes later unexpectedly. >=20 > Coverity issue: 354229 > Fixes: 2df00d562d20 ("app/testpmd: add --portlist option") >=20 > Signed-off-by: Ferruh Yigit Acked-by: Bernard Iremonger