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 C6361A0C47; Tue, 12 Oct 2021 09:50:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B939940150; Tue, 12 Oct 2021 09:50:43 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id D43FB40142; Tue, 12 Oct 2021 09:50:41 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10134"; a="250467732" X-IronPort-AV: E=Sophos;i="5.85,367,1624345200"; d="scan'208";a="250467732" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2021 00:50:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,367,1624345200"; d="scan'208";a="547360325" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga004.fm.intel.com with ESMTP; 12 Oct 2021 00:50:35 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 12 Oct 2021 00:50:34 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 12 Oct 2021 00:50:34 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.106) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 12 Oct 2021 00:50:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dSP/zGje+B55eS8EoXWhMuMLC18BXYmtgttES7N4ANZaqAjSRHHkIGNoT5dbdeOBAKV72b5No422qMTSW5XeVl1qPRmWM1Wg9yhWRBpicHKNT3Ab65380Rexhg0RKMu+kaB7plJ3Md7sbsok99J/oDyZCfL3KmQWvTnCiSMY/it3O/8EBFhK8NP90OedDKow2kdnszBiWCdmr1vcHE5yXeN99o+MKgXliv073X1rXR9HmB6+akkt41mHwlfiSKRrKhLr11hLdTSpCwdKgmiKKloWx+K/43BlckjvJ3Opoe8geLeEToEPKEGpDADXF/dUY5J+4F1KIpIFDC4OuSRuzg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=E1gqRNY4hBU+ZdCxoyZ9dzU7ZJLcp/w5vqDkJIad1YU=; b=GRte6ZT5b1Dt+MviaFnU1SQa0UrrU5rcgoltx7AeqopP9kx55CvKxLpUhhRsnCBsmgeH4u2jf1NcL7kMcLH0YxvoLIkWc1te2ZYUqrkkNBQD5keMV4RNLR2YDmO5814t4Nxr7lUaWf0rydwXEkIWFe7NDexScKW8+qwGrGGgn1Ud2omf7Iz2sDjsxg4G7mgcbFICo3MWxeUaxLLIPYf3OWQegn8iTbrFmHA9W4/pnctCnktcr5ADKnKJxeoHQORuClCFKKLbB/+VKETiOtqj5dru+yVqKhZlI52uszVSTV5aLUQ1ccgc0nXbSxjEY3x6daDN+6rN3d+bi/ku58qwgg== 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=E1gqRNY4hBU+ZdCxoyZ9dzU7ZJLcp/w5vqDkJIad1YU=; b=EtlWoNhieurC9nnt1jtpqqnWeusfaKR9tXxaZiji9+lOqD77LobWsqV/D/Zf1wZlOQVZlRiSkrvyAI1L6jSY9h5HkWep5XU6fsRsF4e66iMm0+OI6JcInDSFPTWE5M1ES6TJjeZGP04DtIzY0Q8tbByStsHUMBx9YjPj4LtwMYo= Received: from DM4PR11MB5534.namprd11.prod.outlook.com (2603:10b6:5:391::22) by DM4PR11MB5438.namprd11.prod.outlook.com (2603:10b6:5:399::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Tue, 12 Oct 2021 07:50:33 +0000 Received: from DM4PR11MB5534.namprd11.prod.outlook.com ([fe80::3d9b:76d7:e274:bad3]) by DM4PR11MB5534.namprd11.prod.outlook.com ([fe80::3d9b:76d7:e274:bad3%3]) with mapi id 15.20.4587.026; Tue, 12 Oct 2021 07:50:33 +0000 From: "Li, Xiaoyun" To: "skori@marvell.com" CC: "dev@dpdk.org" , "stable@dpdk.org" , "Dumitrescu, Cristian" Thread-Topic: [PATCH] app/testpmd: fix invalid memory access Thread-Index: AQHXvzvo642QjDSSfEKKQ7IR2P/rpavO/JVg Date: Tue, 12 Oct 2021 07:50:33 +0000 Message-ID: References: <20211012073624.399404-1-skori@marvell.com> In-Reply-To: <20211012073624.399404-1-skori@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5c291174-e4b1-471d-0bcd-08d98d54f8b8 x-ms-traffictypediagnostic: DM4PR11MB5438: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: OI9lsP4dVQBEY5xsAu6+AM9LvPKIn57iHb3X7edtOynZz2/SAEHC59EuBjGAhktwq+lyv4A/tzxL762bYmQjzdWGUxqm0SL73zARikr7UnpNSJoNdVGrN+j45oKpTxlDzSVSqfvtWZqlfe67BT5+ewwDzFPm8ZjT/oE+FFPj/kN5Q1v6uvFNgB0QdG3j5phMrG5PM8sFgPCbmM0R7PQnZ0CfKkHAKz0lw/YvKGEq/GlkDNV7j+xhcCaKnLkVPfxZqmU8A5ny5GgBQzcxwARmHF413Mxd9ZuakSX+l3cE/WTjEvk7SZvd+yAljvZ2oA2AvGBKBn2Unc9W+fAwW9Nb/+K+Ttla/9TettYVD/1kfJIDbMDRA/uRuYb4N+ngo+I0aCwALB8qZRI9wZ4IlZC2XHeLtmyBOUZZLXJW66yEDXNFHqK0TTFpmwJuRROj2ajGWCiHgMfrlAzzVs5h3C4v/9PfoeV/3ptoQCWBAwD6CbL23Kddj5YXfNOU071GGmz1LO6oIXOOY0QSvpvagqSLpiAl02sARRgWCnTrQcbgpFqiiJFQb0JlqnMuuQq8yvfgwqQLYvZuaAhM7o4vacFidOAeATCirVE/y6NKlY/HGHJCJQNVxdQZ1jgz+msFfIEiU7M3Csv5cnNVuc4narG2+W4DRytqhBEXZV+OpQBdnw/CYhp2ToTOKu1K01woGjghMiYiTlm8I5Ho2am9FE3ohw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5534.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(66946007)(76116006)(55016002)(2906002)(53546011)(8676002)(26005)(4326008)(66476007)(66556008)(64756008)(52536014)(66446008)(38070700005)(8936002)(54906003)(7696005)(6916009)(9686003)(186003)(6506007)(83380400001)(122000001)(107886003)(86362001)(508600001)(71200400001)(38100700002)(5660300002)(316002)(33656002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WBOG59tAbGtTOS8TA558zVCQQsacpLi0z3eZRUhdnU9bAwRVjEHyVk8DS4Y8?= =?us-ascii?Q?7kQEukuzmFJtThF3sGgiptfTwN6A118Z93TQBP4N6CIgTAQ3FNtXT+y2TxPc?= =?us-ascii?Q?61krB/HkxW6XH4mNZdOBmep3AXO8q8LTx99yI7fYpkFvR/xPciznu/WEAZfq?= =?us-ascii?Q?BzriJHPP5sysfXQNVwllirdbIkvXD9qwQgfpPqJDCNJ4u7UNdvdooJS+4QzT?= =?us-ascii?Q?knnkuwvoF1q4/LvOkM6adHol6NegUfy79bj9poF5axGI1UhExcQJEe+Yajhp?= =?us-ascii?Q?wZSrX6ue7poXhEZkh9SRIFbrNro9swlU3B+TodpmUwi07ppBH8/HjQ0X1ZXj?= =?us-ascii?Q?fW9v5Y+833wp2yKdiVOd4zuH2oa6TBU1j6vkzM94WhWcMGoxY2SOKH9DkpVl?= =?us-ascii?Q?z53CBsFuL20BgVe32VAfhklqmFHxJHbwfc4LL2DVtuPIUJI01sKa1UcnfrYi?= =?us-ascii?Q?3wIFfGZQYO+yfM693B5DWI68K+f9BOXXAEZQci6IQQw9C3VUE8G2c00LmOIb?= =?us-ascii?Q?KDpzU3AbYzB57uOnB/DMAP1gAwXcf8BJajbencPRm1XKjQCpmvpWHqHRamRt?= =?us-ascii?Q?jRIYroBKNd1L3lIimbDzYN1DZKKNifMxLFfrPef7XjGJWmzdozdFeNJt1o2B?= =?us-ascii?Q?UyUbgVUGgUF89sF+EtcALbBy93M6AJzyTvXtaDxTeJNN0ay0wVYuGAY4oKJb?= =?us-ascii?Q?T7/vf9W4BxO75nlpqWV5Xb9y/SeuAKK3QYCxw2ezbuDt0LnoG87Izm6mIoL2?= =?us-ascii?Q?zh+Z+a4SHo4U4rzbGzskhMDsgK+XABC7hhGkmRT+dY5BlRruOMsz3HNR9phe?= =?us-ascii?Q?/GXb9YHKsg3l+qvLauXu4DPNO3kaYJbbCmNLqHE90e/RZeTPDZZ4j7m/tFnE?= =?us-ascii?Q?g+4ydc14bFK/Wo9nI9oAPlkasXNrUf0PbE8kNczAy3CO0ot+JcXcpnT4XYwz?= =?us-ascii?Q?6IZwRW+mwpuvO2guIJL4HxFRTBD/ft4IT1DPCUNd9tzge81J7kwpQM/aI2bE?= =?us-ascii?Q?nIGgsOQutha/P/VM8SRpLZcsqOVg9FNU86InyWHnSlTZQ7wDWtUwCR/FxIL6?= =?us-ascii?Q?8tKmPjP0xC8YMkEf+HK4EY+EOph7kj6/Cn8wsL7riI8uSFGRHpCC2DXx2fRs?= =?us-ascii?Q?ch7JfEK/6DlVFgBqU4Dj1m0n/epczL7HUXNWuwRPmixSgaVl4DmluYi1L5N1?= =?us-ascii?Q?qvUNif5+Y9v+yAd/RkcswO4p0p9a2SHU7NqNmd3yA+uxRq3qscesw29ofH6v?= =?us-ascii?Q?FEbG5P7xpQChUmzQLR2r6vWtWmphRcL2JeES3KTAOa7f/Jc2wYUvmFTnO029?= =?us-ascii?Q?HWYZZhDCHFNUKWK6d/WERsFz?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5534.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c291174-e4b1-471d-0bcd-08d98d54f8b8 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2021 07:50:33.7712 (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: p5xQw8f1wmIj2p3xOFlc9XZOB6hMfPUvtCFxlZ4As4+B7x1ccqrw8YirgU+jJ+YtYOnrQlcbeSzNVDkPQiIYBg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB5438 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix invalid memory access 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 Sender: "dev" Hi > -----Original Message----- > From: skori@marvell.com > Sent: Tuesday, October 12, 2021 15:36 > To: Li, Xiaoyun > Cc: dev@dpdk.org; Sunil Kumar Kori ; stable@dpdk.org > Subject: [PATCH] app/testpmd: fix invalid memory access >=20 > From: Sunil Kumar Kori >=20 > During parsing of DSCP entries, memory is allocated and assgined to *dscp= _table. > Later on, same memory is accessed using *dscp_table[i++]. >=20 > Due to higher precedence for array subscript, dscp_table[i++] will be exe= cuted > first which actually does not point to the same memory which was allocate= d > previously for DSCP table entries. >=20 > Cc: stable@dpdk.org >=20 > Fixes: e63b50162aa3 ("app/testpmd: clean metering and policing commands") I think the fix should be for patch 459463ae6c26 ("app/testpmd: fix memory = allocation for DSCP table") Also, added metering maintainer. BRs Xiaoyun >=20 > Signed-off-by: Sunil Kumar Kori > --- > app/test-pmd/cmdline_mtr.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/app/test-pmd/cmdline_mtr.c b/app/test-pmd/cmdline_mtr.c inde= x > b5dcfdadcf..ad7ef6ad98 100644 > --- a/app/test-pmd/cmdline_mtr.c > +++ b/app/test-pmd/cmdline_mtr.c > @@ -101,13 +101,13 @@ parse_dscp_table_entries(char *str, enum rte_color > **dscp_table) > while (1) { > if (strcmp(token, "G") =3D=3D 0 || > strcmp(token, "g") =3D=3D 0) > - *dscp_table[i++] =3D RTE_COLOR_GREEN; > + (*dscp_table)[i++] =3D RTE_COLOR_GREEN; > else if (strcmp(token, "Y") =3D=3D 0 || > strcmp(token, "y") =3D=3D 0) > - *dscp_table[i++] =3D RTE_COLOR_YELLOW; > + (*dscp_table)[i++] =3D RTE_COLOR_YELLOW; > else if (strcmp(token, "R") =3D=3D 0 || > strcmp(token, "r") =3D=3D 0) > - *dscp_table[i++] =3D RTE_COLOR_RED; > + (*dscp_table)[i++] =3D RTE_COLOR_RED; > else { > free(*dscp_table); > return -1; > -- > 2.25.1