Message ID | 20221024123335.3163331-1-michaelba@nvidia.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DEFBFA034C; Mon, 24 Oct 2022 14:33:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B53E34069C; Mon, 24 Oct 2022 14:33:47 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2071.outbound.protection.outlook.com [40.107.212.71]) by mails.dpdk.org (Postfix) with ESMTP id 1D75040695 for <dev@dpdk.org>; Mon, 24 Oct 2022 14:33:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WJHPvT/ucUchY+w0KqSxhtOTKSmEeaAuMwfzFt/O0sKWCoJ7cqlBxo/KBOWJy8nBdKFnzX9t6862dMvv5Goc46T+08p0B+Z+s9AkYdQk0t3folAaV2Al+RNhwk+Sd0ybYMp4qvheAR92yADAEAFD1IrEaEIPw3xJaYOkHOsj62gXpUMBM7koKJXHNE5bIskRcGvwFy5b4AnVY3qAIhEdAx1ioXQYoOoGOeGkf7T8O2Gb3YaaCKUihrAdrWNEck5IqgYQInWlJ8zrUd41FmsdXH20tTKzscNP0V7zyUL1G6RP3S8qQqdrCDfH+I/4SLl/5lCY8voc7PNgtD10jn/ebg== 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=mwsrIuILR2QMJ/0KuD+Asz1gg/+63WxaVyJcNH0nHHc=; b=cjyGUwbL9nljGc9wEbjJBFMDX8V+0mImgAaQkx9tUfgbHQ6xgmQNn9a9gJobyMWs11o1Z22bOR+oY+nb2escCw7rhTEWcYAxLINXE5sYHU4RXeGOXPLVLtBXi9c4XU2V9b6u9OVqQ8vn6FXyXS+JaCwHxeHXAB4TLXMN4m+k5v+z0mmRr26FRtf2/WwqYr28WJ2zeyqd/mV69FKtWMgIQp2gRLc1Dw8yAVuyjXZzP9AdxqZHG7pqRNq+GOqn/iwhp6XbxMUVIpTDKLAod1ArMQ/jPqQ+44Ox17b3NxwE2HSUzIKoGlvZz71VpjzVxHCodb/bc/czsKuQfAgmjyq6Gw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=mwsrIuILR2QMJ/0KuD+Asz1gg/+63WxaVyJcNH0nHHc=; b=F03QOTWK+Kx9FAzn/p0LzemqHR5bJw9fID07QfJapDJRL8wLu3BRlf/89oLmjMdE92nT6kmm/F1NZx13Guhyl32fatLI+c0imCrxHXp8+TxzNXP5QLbvFEfvEk8Hh1UFjvri4iCd2wtReNw+UreoQaLsJCvfumPmte6og0p6TnKG7rhLLx/23JUv4fZE3oz6yeSHj+jFtoDk2GA7TsaWjCny0Eo5/zJj/K4uuIZHwXMGS0WtyfmLrphxF++/HlX2aJP37L53rBKvqLy9cLXvvfbQTtU4EnysPUtxgev0jxnyrWTHDoHUBA2BsJBBDESvgWd547C4ZSlXpRsMG3dHJQ== Received: from MW4PR03CA0017.namprd03.prod.outlook.com (2603:10b6:303:8f::22) by DM6PR12MB4188.namprd12.prod.outlook.com (2603:10b6:5:215::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.23; Mon, 24 Oct 2022 12:33:45 +0000 Received: from CO1NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8f:cafe::2a) by MW4PR03CA0017.outlook.office365.com (2603:10b6:303:8f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.26 via Frontend Transport; Mon, 24 Oct 2022 12:33:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1NAM11FT058.mail.protection.outlook.com (10.13.174.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.16 via Frontend Transport; Mon, 24 Oct 2022 12:33:45 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 24 Oct 2022 05:33:41 -0700 Received: from rnnvmail205.nvidia.com (10.129.68.10) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 24 Oct 2022 05:33:41 -0700 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29 via Frontend Transport; Mon, 24 Oct 2022 05:33:39 -0700 From: Michael Baum <michaelba@nvidia.com> To: <dev@dpdk.org> CC: Matan Azrad <matan@nvidia.com>, Raslan Darawsheh <rasland@nvidia.com>, Viacheslav Ovsiienko <viacheslavo@nvidia.com> Subject: [PATCH 0/2] mlx5: fix miss NULL check in devargs parsing Date: Mon, 24 Oct 2022 15:33:33 +0300 Message-ID: <20221024123335.3163331-1-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT058:EE_|DM6PR12MB4188:EE_ X-MS-Office365-Filtering-Correlation-Id: c258fd84-0ae5-48e4-bc67-08dab5bbfe46 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9792XXVp25yvn4RIrpudvnn+RG5aVaALux6xgICed+S3i1frfIN1hCMzIuZ4akHUy71HxUQ5JITqFLr1qVbX5VRWesr1tm/kAwN6CyPPj5S/yycKtJ+i8AifN3rE4bih9ZBGqvYmIML4qnMRMJy8jsvY9gBCXUMwd2wdp7ArSfeRgJDPMVc5w4ScURaG25iUEttoS3/FBziY/VQdX0yf4ONaikMgA4wZtjnYLxGAqdY5tua1cUhZSXtAVXzhvmKTwfbr7YEPrzDE7qyG2A9lXt1e1QO9wunekb3yNkoWil2Gp3OhVzWSHa/u8htErB36tLMeadNha6mZvVZ2Mn5yj2sRZ+VPDaBRoLwbVBzYtubknyngAY4f+LJabAe7mlBtKpTtpm2RddDco3mFR2ABFQpzjyHAUwK2/GSNdn4nq53gGO7Q2UmSdnlxPUrNUwRASTCvuAeM22QxE4uj1OF+IFXFMM3qZZUs0WW9vrxjQOn69vJewcawRBomeonYL3GtoC+ojHOTITbA6JkxHm1xY91LBbO09Y1+789W/YDmx2Ms6cTNvNMu60i4qX9hZFnliKxP3tgfCxM0+8n0eBHr05knMZRj2B8C1ueu9QxaoYiIgKyPHdewl7/bzUYlP/q0wxdHRI6IxokzcqId1TmW9/aHOKIrABBj2N6TVnH/KJo1qqVk7z/7GgYeIn9XMr/321LzKNee/Dd7V0cK9GbPW7nfNNTG3EdG4pPrOViRSKoLSGq/Zdkr8waD2v3/cRJxjpmBJMFoLdSCn5OZFK0tOw== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(376002)(39860400002)(346002)(136003)(396003)(451199015)(40470700004)(46966006)(36840700001)(478600001)(86362001)(83380400001)(70586007)(8676002)(70206006)(54906003)(6666004)(107886003)(7696005)(316002)(4326008)(36756003)(6286002)(8936002)(41300700001)(5660300002)(26005)(6916009)(336012)(1076003)(40480700001)(4744005)(82310400005)(47076005)(55016003)(426003)(40460700003)(2906002)(186003)(2616005)(36860700001)(356005)(82740400003)(7636003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2022 12:33:45.4344 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c258fd84-0ae5-48e4-bc67-08dab5bbfe46 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4188 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
mlx5: fix miss NULL check in devargs parsing
|
|
Message
Michael Baum
Oct. 24, 2022, 12:33 p.m. UTC
The MLX5 PMD parses the devargs in several places. It gets structure called "devargs" as a member of EAL device containing all needed information. When "devargs" structure is invalid, the PMD avoids parsing it. However, when it valid but its field "args" is invalid, the PMD tries to parse it and dereference to NULL pointer. Those patches add checks to avoid these NULL dereferencing. Michael Baum (2): common/mlx5: fix miss null check in devargs parsing net/mlx5: fix miss null check in ETH devargs parsing drivers/common/mlx5/mlx5_common.c | 8 +++++--- drivers/net/mlx5/linux/mlx5_os.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-)
Comments
Hi, > -----Original Message----- > From: Michael Baum <michaelba@nvidia.com> > Sent: Monday, October 24, 2022 3:34 PM > To: dev@dpdk.org > Cc: Matan Azrad <matan@nvidia.com>; Raslan Darawsheh > <rasland@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com> > Subject: [PATCH 0/2] mlx5: fix miss NULL check in devargs parsing > > The MLX5 PMD parses the devargs in several places. > It gets structure called "devargs" as a member of EAL device containing all > needed information. > > When "devargs" structure is invalid, the PMD avoids parsing it. > However, when it valid but its field "args" is invalid, the PMD tries to parse it > and dereference to NULL pointer. > > Those patches add checks to avoid these NULL dereferencing. > > > Michael Baum (2): > common/mlx5: fix miss null check in devargs parsing > net/mlx5: fix miss null check in ETH devargs parsing > > drivers/common/mlx5/mlx5_common.c | 8 +++++--- > drivers/net/mlx5/linux/mlx5_os.c | 2 +- > 2 files changed, 6 insertions(+), 4 deletions(-) > > -- > 2.25.1 Series applied to next-net-mlx, Kindest regards, Raslan Darawsheh