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 D2E21A034D; Thu, 6 Jan 2022 10:06:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C582741143; Thu, 6 Jan 2022 10:06:35 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2080.outbound.protection.outlook.com [40.107.102.80]) by mails.dpdk.org (Postfix) with ESMTP id B18E2406B4; Thu, 6 Jan 2022 10:06:34 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KswTIAP0vbnBNsC8TmO9Q5q5wl/RLLGqZKKs1XP4cdo/bZnQtM1k1LmPGM6GrNMCGgGJycfd4/cMJMhlljPRkb5PPKKjkc0iD7DoKz2Goy2ZFLwjxHlPNozc2GK9N6GlEk+XsQre1sEEELY5s8nXD9VhroKEDuLWDX+qe8Su3zPPhbcz2rFNEbphazTy35Qb9AGtIke91MeFgADW6tPC42BC92W609DyGO5OyHRjerNtYoeALGX/OjKDLuWwmGnvPYG8PNhbliMYXeo77MeMYfBNboiPLfVWgNZ3Q9pcHCamhRBLZBBBwknL4ZCrrj8uA+DEhLLrngDT/D8nNWAFrQ== 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=fJoHEmvAiF4y0FIV5dC8RyFMQ1BeJoUxOD4stAbs23s=; b=izpO+bNouErmqWbtoTgOMOyi13/Zi+z6vipAZzEnYbAYow5ubcDCuh2fSbeR+NO4TyU9N2Qxr6fG7un0WgM1FgKhtb0p057E676WeD2QgmmXAdfJZ1W7+j+Jv60213dHamayVK2DsZOGMjf7sYGHXpb6awFPzjCphmlhrd1oJcosnhYRb4UULHYZe4RfsRVuoXBZ0FSS8aRGgjW6D2HAMbJBNCjapmcAY1djCIYEjC/0neE/RFw3R0B7vNRMrjBJ/KpIFV9LgGj3CuZFMSc4CgQ5US3ZTMTYbf7eZTa8ZNlHItguvaRDhVPPkdvSq+jRVgYAw5I/jGLno/94s/Reow== 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=fJoHEmvAiF4y0FIV5dC8RyFMQ1BeJoUxOD4stAbs23s=; b=rQ08kXFlVSGlDQaLBwm0ZOWkTuXPI/SB6cRse43pTJLnJInc3PypjSaM+Fg/ctWSb/Ryc9SF1q1aF5XoX1w2+0ZgNiUGecMXBBzkaDPaAX1yKaIQZJthUNKCIlFBmAFjSCpCWaNAC8As9q8xyKSTiIdmYPbXST9pDqqYq+lFdBjmglOqUkPM0aJVwvXZsAmLmDdwk4hGLvVYOxozBk57Mt2IYoFm5m2/bRLcTNY2tSzOQh4IvgdBs3Pqgt2680uiA9RoyKUwRDo3CcyJtdY84hz6KUFZHq3I9AfeZ4XuRClGU1PKw0WYXMYw+EYVdDmPZqgq4D2rJ58GsYInWI5f0g== Received: from BYAPR12MB3078.namprd12.prod.outlook.com (2603:10b6:a03:a8::31) by BYAPR12MB2933.namprd12.prod.outlook.com (2603:10b6:a03:138::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.15; Thu, 6 Jan 2022 09:06:33 +0000 Received: from BYAPR12MB3078.namprd12.prod.outlook.com ([fe80::587a:420a:2c5c:90ce]) by BYAPR12MB3078.namprd12.prod.outlook.com ([fe80::587a:420a:2c5c:90ce%6]) with mapi id 15.20.4867.009; Thu, 6 Jan 2022 09:06:32 +0000 From: Raslan Darawsheh To: Michael Baum , "dev@dpdk.org" CC: Matan Azrad , Slava Ovsiienko , "stable@dpdk.org" Subject: RE: [PATCH] common/mlx5: fix missing validation in devargs parsing Thread-Topic: [PATCH] common/mlx5: fix missing validation in devargs parsing Thread-Index: AQHX8qyFRt27HIg74kKkwk286JWscKxV0/eA Date: Thu, 6 Jan 2022 09:06:32 +0000 Message-ID: References: <20211216184040.819861-1-michaelba@nvidia.com> In-Reply-To: <20211216184040.819861-1-michaelba@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7c3ed655-2efa-4f7d-c811-08d9d0f3d59f x-ms-traffictypediagnostic: BYAPR12MB2933:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: L18lzrt4nUbKf/ONd/F5vh3OZ4bXSXWdIpTuTqQ3bFX9CYjRm7GPmlCFT5Ak7bwkzfitPsFsEsZr3Xjg6tfg2zu0Znt7MCbpTps4BBWFMoxwgyKma3Y36RweCFrum3xmxt1wsifzwJxlkWKBefWhla+G4H1a/HiFxeL/JQrpreqvhPhWiNL7nRF2ii3s8IFNsJu8lRG5gc5m6Na3DlBaCi40cWzyTTSnqCPJGOQ5yOMl7O9O57HxFGcd9aJI1VR+1FhsTNEsBn8x9dVtF6OG6RgfP3g6ErPx5ZeNkBno2MDs3WqTot+qd775blFI2SFe2f3asqNWY1eE+lTtqIS7NyvAfxsCs75FmNJlUyIbGkpLO0s1e1MKk8XG4UoxyvLx7e+ENMn/H/koUQmvDLO9dO4N9szelnX/3CuCviny8AwuK7G9d1Vyb1Zh3UJnKMeA1f/xIzNVJuH86jNlPN6bkyBK/QdOvNm6w3yhaEdpwiN/G/okfMxsI3q7wP+ICCJop6BloMvxwK3tIASDjOACNG+CAuE96yTX6xU+aQLsUTgFMCqfO6MgvfyOc1kEE3yHKgo3slyF35Mwu5PYFajXSF5zD+L022DBUuJZfi6PhoElLMDG6rxxaja/f9FyIqoa8Y6LHp48rAWcdaWoktjygx+07yqEokdt01KqrBA75BXnKerGf32GAmrhtIcj9DKUl43UktnSExDPhaPVaGe0Bw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR12MB3078.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(110136005)(83380400001)(9686003)(38100700002)(8676002)(2906002)(186003)(54906003)(52536014)(5660300002)(33656002)(64756008)(66556008)(71200400001)(53546011)(6506007)(7696005)(66476007)(38070700005)(66946007)(8936002)(26005)(4326008)(508600001)(122000001)(86362001)(76116006)(55016003)(316002)(66446008)(450100002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UxX+9AYRFmCLGKLVudXF80sCX5rWSRZxBdfGZsAHFjEfBdmHXJ2Q1u6DxE1V?= =?us-ascii?Q?78b+4ox9Zc1x8vXSa/4x0pWi7dn8FMWY8AQ8x9ykAOPkCFDtVJ5+5/VTVwqT?= =?us-ascii?Q?ezRcc0H700DwGHWIsf2X7VDp5kOG2IDdJV4VfD2qf3cJslrDzz6gxBMK5FVa?= =?us-ascii?Q?tI5KGVOiEJRluCCcJlZbA3dySz7ZklnUtGSEMaYUa0fXO1yQctrREDeUb3+k?= =?us-ascii?Q?ui+s4ep31/27Oxhz4IXcVH8g64Llz+wp96iDv2tTD76IlRf8kyeHSQeNY8R4?= =?us-ascii?Q?cQkV+4L2cmixBxJwHQ60dMBt79or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?Q?jm/Rbr8qSqiaiq119b9NofX5m9ra8ZGWI5hy0aNTW1Ba5tJl1IUPr79N4UQS?= =?us-ascii?Q?uVerlidn5H4U7axSplaVwGgOaO/1VIlmKsQObTqDKhwg729cSnAGZLaSr7jO?= =?us-ascii?Q?giFEO2uWlz5Az1/VywtaBVLMzXYXydStoLP/fp9UHwfyMjS7tMYMSp7j2y+r?= =?us-ascii?Q?+aw7O8NxmYFwAiKdMe9bIqmUqy/RswaDv5chimCpWFlSKv48ENaUWD63TYk5?= =?us-ascii?Q?Qa+XqymBJ8OEvIInZszDicTT0Xfs87l/G/Ztr3Iwau58toISCaBEbeIypsVR?= =?us-ascii?Q?zSxY/rVlSUU+olwDeUrfq7hJ5sdeZkeA0u5Egr1e0USkmZGMtR9bMA3lgUU8?= =?us-ascii?Q?knrboVev1w9DLCP5+4tSdSge2dX7bb6sGSAZH9E7YZxM179tPnkrd9K7K06m?= =?us-ascii?Q?RAc5n5z0OFPY8OWYhFRXDHw=3D?= 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: BYAPR12MB3078.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c3ed655-2efa-4f7d-c811-08d9d0f3d59f X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jan 2022 09:06:32.8347 (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: ywFy6udwh4s8mXX6rERejPr/hjRFkL81Ora8lO3psY8Lau9zi4fWE1MamNlwpp2vKBgymck9+v+FRAM+Q4785A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2933 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 Hi, > -----Original Message----- > From: Michael Baum > Sent: Thursday, December 16, 2021 8:41 PM > To: dev@dpdk.org > Cc: Matan Azrad ; Raslan Darawsheh > ; Slava Ovsiienko ; Michael > Baum ; stable@dpdk.org > Subject: [PATCH] common/mlx5: fix missing validation in devargs parsing >=20 > From: Michael Baum >=20 > The rte_kvargs_parse function parses the arguments > "key=3Dvalue,key=3Dvalue,..." string and return an allocated structure th= at > contains a key/value list. > It enables also to send a key without value and updates the values in the > following ways: > - "key=3Dvalue,key,..." - value is updated as NULL. > - "key=3Dvalue,key=3D,..." - value is updated as "" (empty string). >=20 > Mlx5 PMDs use this function to parse, but they don't support key without > value. They send the value as an argument to strtol function. > When strtol gets NULL as a parameter it cause a crash, when it gets "" > (empty string) it returns 0. >=20 > Adds a check that will prevent an argument in these formats, and returns = an > error for it. >=20 > Fixes: 85209924039c4 ("common/mlx5: share memory related devargs") > Cc: stable@dpdk.org >=20 > Signed-off-by: Michael Baum > Acked-by: Matan Azrad Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh