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 E03E5A034F; Mon, 11 Oct 2021 11:15:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA0FA410EE; Mon, 11 Oct 2021 11:15:29 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2076.outbound.protection.outlook.com [40.107.220.76]) by mails.dpdk.org (Postfix) with ESMTP id DA696410E8; Mon, 11 Oct 2021 11:15:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ly/G9SAeuFj2puqEuqiPEN9c1d8Y4vzlvkFAU0Tf2tLsKXbA1rMYw7oWSBpNwkC6LvawkbPhL0K2Kzi0UHkcBEdjR7cy+Qu2YWLjKmBEfcItOAUzajeKYo4EWmGnRlWoStaXLL4ySv0EQBK8yqz/FeAqxmFQo9zTHza/hKl/e5DF1E0BO2aj1XBHEbF2TARl/tzi/5ikeF5PxjLpil2glc+zlsXDPo98nAXrFFdjbXU3mD8z6r1oiulATrKVG4ZhPxv7hePWOQZb95xDpx2fIiXXf3IZMhV1F3a3KYFSR8kJLuBEW43Z5KE8c5y/Hf0lmNG0W/S7yosbMOZHtTRz3Q== 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=c0AgTg+T7uMEu9qZ8xtfeAge653G6i0SNED1mulCgaI=; b=j5ZDa8elkiP6AqTEr4KcwhQUHxcrSnYk5U3gdE6iVcKRgg7rBtl5SP8uYgH7kN9fhsx/Iu8czkLg3OdP1xLKCym0BtTzsCxolZxAYIfqr5nSImdpspw6tNmp/ZEFtjjLSMvnMeyCPiGiAlnYnPtPUK6vxmYmD/0cNMkDb9W14+/Wn6AwR1x7OkeD2qysmxlYAo2AtOorA4deBEtajkWm3h1fycW/C1uy3l9dE/M5KxN0I9HjsHaxAIwV+rZ7uiZod+GOvU+PgUsen0W64dhonDVqPGKiZY/DrqQFy6IneG17/vzXo3qjPvnYDhd5mNq7BBiTCDgJZDLqybOm9t+1/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c0AgTg+T7uMEu9qZ8xtfeAge653G6i0SNED1mulCgaI=; b=YNdfQSPW5QiekOHuKih3HgnXqatGLNZvYEBkwNWCxdR8N3bvBCs0aXLA6hRMkwb815W/UBokL6QECjRDFA3QXCJxOuk+9boEPHBwnaAwKHCdjY9eomIdAekiAzs2M13cL8u6ZICFvOUDNovrW4wm5m+7S8TOtYy0qSwcMknHVWx8h897Ei7Vl6pwGk0HBtwMYyP5DX4p5eRacKMVqtzOfOzi9rjlainFXp2o4SI3MaLaQnM2t+Blu+siBBMSpCQTsc81POrLOYvetDyiqg1ja7JqhLIccHzDyZnLG8YzupS7vCDLm6Bb4oNSGefKFs8cFpWLv2FPULUsyftQPZJqyw== Received: from DM8PR12MB5400.namprd12.prod.outlook.com (2603:10b6:8:3b::12) by DM4PR12MB5357.namprd12.prod.outlook.com (2603:10b6:5:39b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Mon, 11 Oct 2021 09:15:26 +0000 Received: from DM8PR12MB5400.namprd12.prod.outlook.com ([fe80::d03d:1f75:ca20:6a32]) by DM8PR12MB5400.namprd12.prod.outlook.com ([fe80::d03d:1f75:ca20:6a32%6]) with mapi id 15.20.4587.026; Mon, 11 Oct 2021 09:15:26 +0000 From: Ori Kam To: Slava Ovsiienko , "dev@dpdk.org" CC: Raslan Darawsheh , Matan Azrad , Shahaf Shuler , Gregory Etelson , NBU-Contact-Thomas Monjalon , "stable@dpdk.org" Thread-Topic: [PATCH v2 3/5] app/testpmd: fix hex string parser in flow commands Thread-Index: AQHXvjEIE4ubP5M20Eu1cjha+AiXrqvNhHAg Date: Mon, 11 Oct 2021 09:15:26 +0000 Message-ID: References: <20210910141609.8410-1-viacheslavo@nvidia.com> <20211010234547.1495-1-viacheslavo@nvidia.com> <20211010234547.1495-4-viacheslavo@nvidia.com> In-Reply-To: <20211010234547.1495-4-viacheslavo@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: beb25242-b8e1-4d6f-c6c4-08d98c97a9cb x-ms-traffictypediagnostic: DM4PR12MB5357: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1091; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5AaWVozaG5+uCjRacSO8/CI1GsuRFfPlkQi18RQ9h7X2AX3L6qGELy7qBsAz4RVezaMUvsAeCc94IoUB4nSZAn9knrxqSlPOt9E4NHTXy76ziOyg2qj8yxCRkfgBq7nBgAJToM7gEvWUM8O1FfE02DBmTLXmbOFDb8dMjC6eLOabfZvDO1WO3RZSNalfG4nSR5maKUCt87ozn5uSwY5IhXTPNEKO5iRHRXUfNxw1cLHdr6Coi22441GD85+IbD919TO9OK39hWsW+OuH69i40+N2ZSZ5BP3MasVoPGFhh2jXEzXrkbmRWPGFEFqSjsGCk0r+yCFFfc9dooUqxflpZKoZrEugL3gL4F3uLtmq9xf1NgGtgMmiBqCoNptmSbfCVlhpqAoeVEd4YkV4a+8wljID3V3oxob0Ohg8o5u7R3uJWAr85cD19Ihsl/QbZzRiXM0V/A+ljEw5u5RY0gXJoXCAkimDYZCroJElaviw73B0ilCZqPO1deF2nCBhxkeF4UIo2TwgC9a3iF3qqAFqT/+jLrVkOsN+RE7ZxsNqLOtGXP0E/G65sJfXdl8TnOlOy1g8f2vMDBDDrbWZR7PUx3hFcUz9ZZ0Y4lJ5VhxHj55qZZWfrU9Na2UAEk/XG1vZVZhOrmVoG31cbTVqkXgOgMvuloUMwccmlzW3Co0kg+fP1FUAEckZX4RXYBxI2+DBqShb3GNDJ62c2M79/dpcaw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR12MB5400.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(33656002)(2906002)(122000001)(38100700002)(71200400001)(83380400001)(86362001)(54906003)(5660300002)(6506007)(66946007)(52536014)(4326008)(9686003)(110136005)(508600001)(186003)(26005)(8936002)(8676002)(316002)(7696005)(66446008)(66556008)(64756008)(55016002)(66476007)(38070700005)(53546011)(76116006); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?bMK7A3gp5cwW1kNe8M76WfFnLoMXFossKEvZ/7pfbTO4Pnst48I+JA0C56fc?= =?us-ascii?Q?YsGdVusLJxkYViY9emmij0nBXMV4ecKnodM69CgqQum62HKPWhIqUpSckVvw?= =?us-ascii?Q?fsoduoB0szqNAiR8FiKroVFitesxUTaqn5YT+rAZw18CNrcmcd7Z0NJdX1hy?= =?us-ascii?Q?b+uJ8r8uf1j6VGES1Y7n7bLBOZa6wKCdj3ByUysS1F2/esD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bb0hzfIGR/Nr6rCU5muGksKuuheEHq9Htat?= =?us-ascii?Q?Vcu6V9/dkLxLd9Umcvy9hLbd9r2U50pro9378kcuj0MvM83U1vMLt9ccp52o?= =?us-ascii?Q?8boAMPkQk2m4lE3i3T8KAey0QIV2Qd4mFGXAs8MlLyqAwcMSvGuZyAbDTI4Y?= =?us-ascii?Q?cUhPfS420Rvo3y3gcz9GEblqXn/xrVuZmY0mwdZXRWp+3Gcw160VEAPvf2ac?= =?us-ascii?Q?UuMocd3F1Yh+S1lE+nWiiGnd?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR12MB5400.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: beb25242-b8e1-4d6f-c6c4-08d98c97a9cb X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2021 09:15:26.5493 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 6ueidgB0AJ9Bzv+1F+1wF4X4+g//Z70gGVfJ+FiTHI6jT17EywxyTwVf9crAec805UvA67aJDWGBIci2nSY5Ew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5357 Subject: Re: [dpdk-dev] [PATCH v2 3/5] app/testpmd: fix hex string parser in flow commands 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 Slava, > -----Original Message----- > From: Slava Ovsiienko > Sent: Monday, October 11, 2021 2:46 AM > Subject: [PATCH v2 3/5] app/testpmd: fix hex string parser in flow comman= ds >=20 > The hexadecimal string parser does not check the target field buffer size= , buffer overflow happens and > might cause the application failure (segmentation fault is observed usual= ly). >=20 > Fixes: 169a9fed1f4c ("app/testpmd: fix hex string parser support for flow= API") > Cc: stable@dpdk.org >=20 > Signed-off-by: Viacheslav Ovsiienko > --- > app/test-pmd/cmdline_flow.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c in= dex > 736029c4fd..6827d9228f 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -7291,10 +7291,13 @@ parse_hex(struct context *ctx, const struct token= *token, > hexlen -=3D 2; > } > if (hexlen > length) > - return -1; > + goto error; > ret =3D parse_hex_string(str, hex_tmp, &hexlen); > if (ret < 0) > goto error; > + /* Check the converted binary fits into data buffer. */ > + if (hexlen > size) > + goto error; > /* Let parse_int() fill length information first. */ > ret =3D snprintf(tmp, sizeof(tmp), "%u", hexlen); > if (ret < 0) > -- > 2.18.1 Acked-by: Ori Kam Thanks, Ori