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 B53B1A0C47; Tue, 12 Oct 2021 10:21:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 79A614067C; Tue, 12 Oct 2021 10:21:21 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id CD90340151; Tue, 12 Oct 2021 10:21:20 +0200 (CEST) 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 SMTP id 19C07360030602; Tue, 12 Oct 2021 01:21:19 -0700 Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by mx0b-0016f401.pphosted.com with ESMTP id 3bmpv4uruk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 12 Oct 2021 01:21:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G0Kqk4m1/LP04nQEDBMVgi5SO6kqOmujzr9E5TXrRpQZuHCgLyoxNzN8dzxy8waHzU1+9SZG0YATC+J1rQfdKQgGt5yW0aH4kRF6Lq9T+W7CzD/PkSJf24H2wi/D9ElD8xxhJ+YJ47AHNG/4dF8qGo3T6xNCe3Hh5JXRlYU8q+A8GTdQjB5nsGIHcwROW6ZtpK3KWJR4Cala4wuoezY4BQFjoQC9M8WiFo3Njo7Sew42u/iDzVECAvs9lZKTkAw+mFEDsfC6BMuFjAFzRIoXP1EicXxaOhiceQpxluKJGJ6OBnaoHO2gASSGCI0MgN+OV8l4M7j08LtwmNzGlOD81g== 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=pCI25azufZkhCuKRPvnDxajOrrLjpFM9FzC1Xz/HROw=; b=L+IvL/YS3TIAWJWQIpMAJRbr0+MBDXEpodMhgGPWJRe9cH7bpDqhCvnw4hZfMKHhDOdoSQQRO46yyWxiBYmGpYC8AKzyenC712j09tQGfmk/eF5sehWZbktsZxBjTSWUgv7QsKGNJjbGfw6aa/nyEtkDQ5v97LOgOhSb+fqPmY24ooeh4Q7NJWErvfl0rhrO9cczQTAElCKvzADidRR+6vgA5hAI3Iyb2w2uUTAEALWk0UtPIgi0dgOoyZlKYwialC5ULk85MoQ2tP5KfzurXzxzGGen3PoyiOwwEKuD2CCbqVuqtswHXOEt/aO57SzLMzI8kePapL0Y0mgEH6p9eQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pCI25azufZkhCuKRPvnDxajOrrLjpFM9FzC1Xz/HROw=; b=EcpQyHb4AJoJvj7Pdy2G6mDDw+v63qvwk48vrjZCt04lMBU6ZWtmDgzWLk+UCw8ZlFBPOoT6aKw9j8gk43oM5YfQCPQHXcv+yrgIh22cxWyIQFMGbCqH8po/9cCdrJadtBMqbxVHgZ3HyPr8rW3ZWP7e6Q8Nm/xVzk3JlR3sAmg= Received: from DM5PR18MB0938.namprd18.prod.outlook.com (2603:10b6:3:2d::21) by DM6PR18MB3508.namprd18.prod.outlook.com (2603:10b6:5:28f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Tue, 12 Oct 2021 08:21:18 +0000 Received: from DM5PR18MB0938.namprd18.prod.outlook.com ([fe80::510f:8784:d7ff:99d3]) by DM5PR18MB0938.namprd18.prod.outlook.com ([fe80::510f:8784:d7ff:99d3%8]) with mapi id 15.20.4587.026; Tue, 12 Oct 2021 08:21:17 +0000 From: Sunil Kumar Kori To: "Li, Xiaoyun" CC: "dev@dpdk.org" , "stable@dpdk.org" , "Dumitrescu, Cristian" Thread-Topic: [PATCH] app/testpmd: fix invalid memory access Thread-Index: AQHXvzvhZDAF2pdtYUuiMJKwteG0tqvO/TOAgAAIdWA= Date: Tue, 12 Oct 2021 08:21:17 +0000 Message-ID: References: <20211012073624.399404-1-skori@marvell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1fe0ead2-5d11-43f0-3442-08d98d5943d4 x-ms-traffictypediagnostic: DM6PR18MB3508: 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: R0D2y8z7Ay4guVgwcc6Zt+6POxL3NQhfTNdFTqK9cvhcslObljrG8Z2sLX1GoscKqKzckfeMFdujvsEbOknTPIeBCbrHiZNDVlLwFz7wdnf0+CWON4SZ9vQgKYoz3uGE9Yd2vyJ0PbPhUEEg3ONYC1vsOnlh15a9uKKqOAwMP+hkItyA5QEyAGnuMqRUfgSslw5eCe+nTPZshdmwsFRHx+yCg4V80/W/qMK5E5nWf05go43Pxx0ZN/r0A7a1LyghPiJvmCnEAhLsKre7BQ+ZP7M5nHe0SvXZiQluFo75xEV0r60y/UqROaapuKhCtIf34FjucA6mwReRMWUYd8rn/h0RNzEy2LBrDFGfNQbtO1m4SVj1hIFvQYOY8wKm9wF/E4CItYJYuHLUdYa3aHdRexZ/xSQ/VKEoCLIRSFvwLoHPV7F33rdXpOlfHA4Rf87657lObqxkLmSRCJe5QgMmm6aizVIX2B8FldYoipbEISpl4/y7t7w02ElNT7A5frlrjcRyKlfYocCq9ie+9FTDP/0iAHTnDmvni4Qj+XUS8fINlhYWb0FZ2owvWwmJ1pVdolveU4+LYInslr6wdIJAFwZUHtjuO8kkhNHSRTZO71ieVCizItD/9KYL2TBpAnoFd1malmZOPqSzUUM1GEdUpc5RMwdsh8K1I0PnG8yHkf3eG/6QbA9Dfbduz/UZ+cceTLY2FOnyU4T2lSD6qOfw4Q== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR18MB0938.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(5660300002)(71200400001)(6506007)(508600001)(316002)(7696005)(2906002)(33656002)(26005)(55016002)(38100700002)(9686003)(8676002)(53546011)(38070700005)(66946007)(86362001)(186003)(6916009)(8936002)(76116006)(54906003)(122000001)(64756008)(52536014)(4326008)(66476007)(66556008)(66446008)(83380400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?lkdL/uk1FGdo3iJL+0xU2KXJtT2R3XzPVbRY7h49C9cFa/4KeeDJacNXFiar?= =?us-ascii?Q?DHcd/TMCAkxvulRh8XMLx5qfHmZlKHMLJ+zW4kIrMZ/fPpd84ZNdShcm01Br?= =?us-ascii?Q?QGcTKJwAwrny15Tk32jY6B6kHZeGvXHfLNxmKAvY0PwVEIERJKf+9zs2ZmSB?= =?us-ascii?Q?xurlCwpgWLqZqgqDfClOuCKF2clWTYDixuoq5KPGz22cCGYykDRmIGia8m/A?= =?us-ascii?Q?7V29GjbV+7ji3rhkyp1xzso69poyutS3ln+81WzwIUQ8i/4RJypPWWSbVsO1?= =?us-ascii?Q?tYfoG/djDACUF6h7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us-ascii?Q?gcj2MQiWysy+iS8lKkHcWD8S4PPkuuxLs4GE6/CkpK1sRM8QQFEoeJX8EQgl?= =?us-ascii?Q?I93kqS74M+hogeoL6OJ0/Jj8p4KxMFZEpKd67CX2raE/VyEzkljGHBuf3ZIx?= =?us-ascii?Q?WDkRKHEDALoqpNKVwz1Z0nzJ?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM5PR18MB0938.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1fe0ead2-5d11-43f0-3442-08d98d5943d4 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2021 08:21:17.7202 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: BOP2fokK52LlL3T8Q6IMR2hQ0FPkxk+tx4E5jiL4gutMqS+dp/i/d1pPBxfMUFSnXZMgE75FiwZR5qPDe9aEqw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR18MB3508 X-Proofpoint-ORIG-GUID: pMknqh3DIzxTolGbfQm6UeFa6Za52lYt X-Proofpoint-GUID: pMknqh3DIzxTolGbfQm6UeFa6Za52lYt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-12_01,2021-10-11_01,2020-04-07_01 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" Regards Sunil Kumar Kori >-----Original Message----- >From: Li, Xiaoyun >Sent: Tuesday, October 12, 2021 1:21 PM >To: Sunil Kumar Kori >Cc: dev@dpdk.org; stable@dpdk.org; Dumitrescu, Cristian > >Subject: [EXT] RE: [PATCH] app/testpmd: fix invalid memory access > >External Email > >---------------------------------------------------------------------- >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 >> >> From: Sunil Kumar Kori >> >> During parsing of DSCP entries, memory is allocated and assgined to >*dscp_table. >> Later on, same memory is accessed using *dscp_table[i++]. >> >> Due to higher precedence for array subscript, dscp_table[i++] will be >> executed first which actually does not point to the same memory which >> was allocated previously for DSCP table entries. >> >> Cc: stable@dpdk.org >> >> 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. > Ack. I will update and share v2. >BRs >Xiaoyun > >> >> Signed-off-by: Sunil Kumar Kori >> --- >> app/test-pmd/cmdline_mtr.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/app/test-pmd/cmdline_mtr.c b/app/test-pmd/cmdline_mtr.c >> index >> 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