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 4B4CB43E57 for ; Sat, 13 Apr 2024 14:52:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4616140697; Sat, 13 Apr 2024 14:52:29 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2041.outbound.protection.outlook.com [40.107.92.41]) by mails.dpdk.org (Postfix) with ESMTP id B22E7400D6 for ; Sat, 13 Apr 2024 14:52:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FZ9ud7ywNlMdQZmFeGuiptK/lRi/m07XsbKnnpoqqUEKTkwahKUfyq/hOVAkKDM2kVhQJ2WG+Zh/ATJu1VFDgDCguPynjSMjugogivHRSNtbYLDiWa8U8QG+dEWkRUYcqG4vXozFBysy+fbuJtxP0TktnRDwMi+gIhvVCFH8zkX1N2uu/PekqdX5fot3rF00xfijrJjjVQd8TH7P5W/kS8Rzi6NKvRsSOqJl27DVWGkefwClOY/pWCq1ATzjI0VWVFaDXfHwCN01YrTMaMzvNQQRE9x2+sTAjeytQ5y5IvMCZE6CZ+Z8AywufreRQIyuf0KzUE/vggpQHGQzHqhXSg== 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=yjPBz6amAI5HtxxjgHww0vHdtiFTvYHxAGMEpUjsMWo=; b=GVqpysUS4gI/MYvaXkZKqkMNNK3ofIbM7U3nqX2q1x04VGKP2QXh5Quo+1a2610yJf0ppkpbZnmroZlRbdGrl7cT6dOLTzeRhVfEvXanrotJ2E2Qle1u5M34bzZFyhWC9uE+4Mos5kPQ4frpTjqBHizXnnbtBoMxYXWBiGEkP4YaRL4AE9XvAAJ5R1StJuREtO2dAoGcEXUHUKxV1lZlzmplMU1g7WIl6/c/krEWi27vN/vsRj7x7cQ/VO1ZWxmpF94FOKbUuXO7nnZgwb05HLCQxNUMKAfVzWajx1Y2CVtsYF6d2YNBRqYAhhTYH0iYs/idW4UBWLowRmAykFXd8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=broadcom.com 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 (0) 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=yjPBz6amAI5HtxxjgHww0vHdtiFTvYHxAGMEpUjsMWo=; b=GkyXNv5VO4zXAkRP5Kt357UCT22v4ojaaddpZvAfwK6gbs1x7w1/9xQS3UuKSUOn/WaOKiRYrXGw/4mfPtrzHvPiS0wfhNFWVYaau9HFz8oeTDon6pdqFwoZrVGYtIdmlH7S6CbvnsLBtoeBCFo6XVWVgVTu4/meuaZseqLxyNgd9CfWnwXdpZ6wPOY4XHR2g0l3dHKGGIRtok4RYj72+qhE4cJmhue0IhDcPfiF4cJYalmgP8pmWy+9ADH+yfrw4t1gLlm1JkPX+IMJ+m/KL55p3WTm6NjerCF2I05XFsdK574kYAFzyI2DFMml/uv5OFvsHmJOrdBvJ9iLFMA/LA== Received: from BY3PR04CA0028.namprd04.prod.outlook.com (2603:10b6:a03:217::33) by SJ2PR12MB9190.namprd12.prod.outlook.com (2603:10b6:a03:554::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Sat, 13 Apr 2024 12:52:19 +0000 Received: from SJ1PEPF00001CDF.namprd05.prod.outlook.com (2603:10b6:a03:217:cafe::46) by BY3PR04CA0028.outlook.office365.com (2603:10b6:a03:217::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.30 via Frontend Transport; Sat, 13 Apr 2024 12:52:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF00001CDF.mail.protection.outlook.com (10.167.242.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Sat, 13 Apr 2024 12:52:19 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Sat, 13 Apr 2024 05:52:14 -0700 Received: from nvidia.com (10.126.230.35) 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.1258.12; Sat, 13 Apr 2024 05:52:12 -0700 From: Xueming Li To: Kalesh AP CC: Ajit Khaparde , Somnath Kotur , dpdk stable Subject: patch 'net/bnxt: fix null pointer dereference' has been queued to stable release 23.11.1 Date: Sat, 13 Apr 2024 20:48:21 +0800 Message-ID: <20240413125005.725659-21-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240413125005.725659-1-xuemingl@nvidia.com> References: <20240305094757.439387-1-xuemingl@nvidia.com> <20240413125005.725659-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CDF:EE_|SJ2PR12MB9190:EE_ X-MS-Office365-Filtering-Correlation-Id: cfe61315-4754-4672-5bdd-08dc5bb88e04 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Rdl+jU6mDR0OQzz44yJKhy9iV/K2QBRIKLA7beXKlDjf8nQUOID0DeqrE1N9a1ysDowsUsOrfhlKgP9j1kF3QdgzkBxyK2KYE/0uLWQ+zuMkLViQjK2ZRTZn14FS8W8bODLcv31jVSRvmBBfW3o11qA1Eg884/FAA/pz2WpaoVC5GNOX6x83Nikfmi4ooKgqwWSZnliRdB7EhBdK/ydAqufFLtktqj1TG/h5H/hfmb5ibT9sRiPZaEasif8WGT41x8tPPI5vfYGK5P99IvS3vJtMDVvXNlFGxJs0rc0G2dlZ9mJNt6nuHbXNZzUxTCgrrX3EN6CTd02VGbmEKFCKKXt6wsZ0v4O4gfgR/w/iqpjNMiMYtBiU9bj8N9Pd6cV+EXb8qEKmpsE04+ebNeOeJiZ3mvsWbIVRXAPKs8+Z6/ZdP92em50KVZ2Dtj+Xh5PmK/YdA/4+N4NEHbfvkLotdboK0NUbPFCNDhYRf/+0VDXQ5fHwjj8qrCWMP3shXeAK+1NCGJhll/13Z+detcHUG/pR1F7/pu5LallHYiv6O6VbZ02BPq5PDnH+cH90BDU+wcK8s0MjZg5fQnW206ckzogfm0yks3UoxN6iMkFUXFavXG9fJ1hh8TuniwrGQtiIFWMc8Sl17VGkjND1vdd7SKvd5OEfhqH+NgDmG6vVnV/3tmMGIT7h+7LiqQGctvHM/2YyZTEjcaI4xixpey7KVyHvhtZuIR4veiLm6aNE8ki7yrL+rWFb3ot/U7YyzV7k X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(36860700004)(82310400014)(376005)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2024 12:52:19.4215 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cfe61315-4754-4672-5bdd-08dc5bb88e04 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CDF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB9190 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 23.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/15/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=a71de447a2351b7c5b4f95446b5382e253415232 Thanks. Xueming Li --- >From a71de447a2351b7c5b4f95446b5382e253415232 Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Wed, 7 Feb 2024 01:19:02 -0800 Subject: [PATCH] net/bnxt: fix null pointer dereference Cc: Xueming Li [ upstream commit 68eeafdef4db7362ff5307995b670a98f65f2493 ] In the recent changes to rte_eth_dev_release_port() the library sets eth_dev->data to NULL at the end of the routine. This causes a NULL pointer dereference in the bnxt_rep_dev_info_get_op() and bnxt_representor_uninit() routines when it tries to validate parent dev. Add code to handle this. Fixes: 6dc83230b43b ("net/bnxt: support port representor data path") Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_reps.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnxt/bnxt_reps.c b/drivers/net/bnxt/bnxt_reps.c index a15f993328..a7b75b543e 100644 --- a/drivers/net/bnxt/bnxt_reps.c +++ b/drivers/net/bnxt/bnxt_reps.c @@ -32,6 +32,14 @@ static const struct eth_dev_ops bnxt_rep_dev_ops = { .flow_ops_get = bnxt_flow_ops_get_op }; +static bool bnxt_rep_check_parent(struct bnxt_representor *rep) +{ + if (!rep->parent_dev->data->dev_private) + return false; + + return true; +} + uint16_t bnxt_vfr_recv(uint16_t port_id, uint16_t queue_id, struct rte_mbuf *mbuf) { @@ -266,12 +274,12 @@ int bnxt_representor_uninit(struct rte_eth_dev *eth_dev) PMD_DRV_LOG(DEBUG, "BNXT Port:%d VFR uninit\n", eth_dev->data->port_id); eth_dev->data->mac_addrs = NULL; - parent_bp = rep->parent_dev->data->dev_private; - if (!parent_bp) { + if (!bnxt_rep_check_parent(rep)) { PMD_DRV_LOG(DEBUG, "BNXT Port:%d already freed\n", eth_dev->data->port_id); return 0; } + parent_bp = rep->parent_dev->data->dev_private; parent_bp->num_reps--; vf_id = rep->vf_id; @@ -539,11 +547,12 @@ int bnxt_rep_dev_info_get_op(struct rte_eth_dev *eth_dev, int rc = 0; /* MAC Specifics */ - parent_bp = rep_bp->parent_dev->data->dev_private; - if (!parent_bp) { - PMD_DRV_LOG(ERR, "Rep parent NULL!\n"); + if (!bnxt_rep_check_parent(rep_bp)) { + /* Need not be an error scenario, if parent is closed first */ + PMD_DRV_LOG(INFO, "Rep parent port does not exist.\n"); return rc; } + parent_bp = rep_bp->parent_dev->data->dev_private; PMD_DRV_LOG(DEBUG, "Representor dev_info_get_op\n"); dev_info->max_mac_addrs = parent_bp->max_l2_ctx; dev_info->max_hash_mac_addrs = 0; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-04-13 20:43:05.800972282 +0800 +++ 0021-net-bnxt-fix-null-pointer-dereference.patch 2024-04-13 20:43:04.937754010 +0800 @@ -1 +1 @@ -From 68eeafdef4db7362ff5307995b670a98f65f2493 Mon Sep 17 00:00:00 2001 +From a71de447a2351b7c5b4f95446b5382e253415232 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 68eeafdef4db7362ff5307995b670a98f65f2493 ] @@ -14 +16,0 @@ -Cc: stable@dpdk.org @@ -24 +26 @@ -index 3a4720bc3c..edcc27f556 100644 +index a15f993328..a7b75b543e 100644