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 47573A034F for ; Wed, 10 Nov 2021 07:58:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E37540142; Wed, 10 Nov 2021 07:58:46 +0100 (CET) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2068.outbound.protection.outlook.com [40.107.100.68]) by mails.dpdk.org (Postfix) with ESMTP id 6C66840142 for ; Wed, 10 Nov 2021 07:58:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dCcMnWV7lWRaVUoWVNzyE1jH1WNJ/FOPXgTl67arYRYwZj2cBx6nJtSe4y7JUidy0ngDCRRs2Ovyk0dFMGlvO67G8NTJcDAu6bQXmIFXzV7v45cB8NtiV2fq0JRvXiccbBx2SaYIM+vKxfsbU3nCEvGqn47CNSkrVjHNrMDJAgJhNg/jLtPQR3ZEEi+8wklT9V3hUPy4NamofOwWcWhADE8OyFAH2/K7NzMjpk5XwONfUfDPwSch4eGITOR4c3hgjYa2c5bsjuFdU8G3nNnjPdO7WhCdEQytVt+6VdNbUqfGmbGsZp8LBhXAk1HrAQdpaf/YhS+EUaKyCnTXDc3kHQ== 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=S1XaRK/qLng8Bl5lol66xRdeG4Z+N/XW+kcSHn7jQ4o=; b=lF5/K19Kg1wGb7T3Ccb7N0UdoFJ0J7mbaE4OUZBKFvt2WaO0st7GWCuAv7fetKaT+aAkwpgVUu4YyIX+KJ/kL2LKqqKeZ4p82jOggRdtqtRsq5+ez9FZ1prQjaDnapR8EWGOEGHwokvZoeUU59fpTVPaCJRrC81y4ZOtObhSWFEx5EUCDFGnj1YylHGOTei8KsJ2olZoPYY9qybIgR93aSzLIsKwplZomfd9z1Yfm+M0g/uiszINRa7VJ4+w5U/QQiGbz//5ac+/NUTu0wpe7PLiDGhlMt2s8rKzrbI6OR0Z4+8kD1BWmeQtn46oqrIQxgNkfV9lygkbJH9PblqP3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=S1XaRK/qLng8Bl5lol66xRdeG4Z+N/XW+kcSHn7jQ4o=; b=TBKEKpFdTikTbXaK3AWAam2LXO61EOSSLCCf5Q8U3NsvQkoPou2PFKOvyKkpj+s16AyBDrXuegEOUf4JgqeVSs/belNzj41lCIWAIsRXJMrU0X8cu7QsqhgqLAb1UPiXXbogmhFfJKFcgtjh8+Nt7b42XEA1LhQutdA0UJWWS5eK+udQExPE+rGEOLEY0gyhzBwllor0arH0G1OaXfUwpJq7wTJwUoOiH1S2gDA4jqMAkkPCX68q4UR+Kauv/pLDbXH1jCp2GEjBSWflFShz+XFSNRqnjWAvOT2pglzjbjrHNFM227bVf/DWpSxf4pRob2Biu8QjxcLD3f8TM9KVlw== Received: from DS7PR06CA0033.namprd06.prod.outlook.com (2603:10b6:8:54::15) by BL0PR12MB2467.namprd12.prod.outlook.com (2603:10b6:207:4c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10; Wed, 10 Nov 2021 06:58:41 +0000 Received: from DM6NAM11FT056.eop-nam11.prod.protection.outlook.com (2603:10b6:8:54:cafe::54) by DS7PR06CA0033.outlook.office365.com (2603:10b6:8:54::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16 via Frontend Transport; Wed, 10 Nov 2021 06:58:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT056.mail.protection.outlook.com (10.13.173.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:58:40 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:58:37 +0000 From: Xueming Li To: Ferruh Yigit CC: Luca Boccassi , Chenbo Xia , Thomas Monjalon , Andrew Rybchenko , dpdk stable Date: Wed, 10 Nov 2021 14:32:03 +0800 Message-ID: <20211110063216.2744012-240-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 68f5f876-d700-454a-3b39-08d9a417875a X-MS-TrafficTypeDiagnostic: BL0PR12MB2467: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YvXg3jBDnlxHza55OuB5Ps/PkRYwK/TlvMq6clNFu/hNt2Y+X+k2QzDE5jdt12SDRoZhhNXcrO5wVn0rD1PQ6+swPwTvzcL3kgIYqNGZdLstn9mHFr1iWoM/F8FDpd3+BB3YbFVv8tgxb3jKvbDMehcz8ZDpHPgDUIJ7RmpV8ZXS5P09/M+6MWE41Fkh6d/KMRnyA8eJBiS04gxODJ2In6/IwsdZGCao7Vr1SfcQ+vfO0U8Jwby664UKRtScadvY681ROW4DW6Rd+nnk399Vu0vnv2UigtK+FKHVxNDg9VrvPKP14iRK2dh7pH+SBQ08eUstRgy2vtH6HJ87IVh685Tsfxj93l4McPM5kFcq6Ha4v6Md0eGjXixyXS3t/98zc0tX65zTZSgkGkdmVq121cnlR36OF6JY4jTO37E+yc3Hmefy3eF/YV8NdxWnt0SXhg8l/Na4YCDAZ1/9o3frxA+IRtzxf+eGsR8MY0u9bi5QH/WcqdeYcitw4t/c+jo6d6JNXMlv9xMrz895YUJho5mlZdThlWzpRxz7hUFQd5a/3PhV2qm3qs0ijzZwBRzJYMAWheWH5nkOK5ct+doTN6oLrU6Ba27GMaNIdD0c5rrNF+T0W7ThJZasC3w+y459YJqcWEpwfz7XXCTZ1FbxwzCQV6j0bX12jWoidSS+EflMB+JGNRCgXygjk7sYDn0h6w9/yrAf1+HFY8dqPahOZM1Pz6ejGrlBtzGVmVR4bOwiz2AZd/Drn0XEBHe9ktWySK0Zn4ZkswH1hOVaUtImHmW+NbGz0ZJIDAy7dw3zU1HPv5ic4TjDCxyZ+if5Be+jmKG3KMCtc8Qd6P8So8xDUg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(70586007)(36756003)(8676002)(70206006)(316002)(36906005)(508600001)(336012)(6916009)(1076003)(54906003)(82310400003)(966005)(53546011)(2616005)(2906002)(7696005)(4001150100001)(5660300002)(36860700001)(6286002)(426003)(55016002)(26005)(8936002)(86362001)(16526019)(4326008)(186003)(7636003)(47076005)(83380400001)(356005)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:58:40.9667 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 68f5f876-d700-454a-3b39-08d9a417875a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT056.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB2467 Subject: [dpdk-stable] patch 'ethdev: fix crash on owner delete' has been queued to stable release 20.11.4 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. 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://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/ffe143c3a8ee84139231095668462f5051d38a79 Thanks. Xueming Li --- >From ffe143c3a8ee84139231095668462f5051d38a79 Mon Sep 17 00:00:00 2001 From: Ferruh Yigit Date: Thu, 4 Nov 2021 11:04:21 +0000 Subject: [PATCH] ethdev: fix crash on owner delete Cc: Xueming Li [ upstream commit b7ade5d31a747fc044a9816b38814b47a6e1b201 ] 'eth_dev->data' can be null before ethdev allocated. The API walks through all eth devices, at least for some data can be null. Adding 'eth_dev->data' null check before accessing it. Fixes: 33c73aae32e4 ("ethdev: allow ownership operations on unused port") Signed-off-by: Ferruh Yigit Acked-by: Chenbo Xia Acked-by: Thomas Monjalon Acked-by: Andrew Rybchenko --- lib/librte_ethdev/rte_ethdev.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 9b695e1e1b..dd5ce4eb1a 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -718,10 +718,13 @@ rte_eth_dev_owner_delete(const uint64_t owner_id) rte_spinlock_lock(ð_dev_shared_data->ownership_lock); if (eth_is_valid_owner_id(owner_id)) { - for (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++) - if (rte_eth_devices[port_id].data->owner.id == owner_id) - memset(&rte_eth_devices[port_id].data->owner, 0, + for (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++) { + struct rte_eth_dev_data *data = + rte_eth_devices[port_id].data; + if (data != NULL && data->owner.id == owner_id) + memset(&data->owner, 0, sizeof(struct rte_eth_dev_owner)); + } RTE_ETHDEV_LOG(NOTICE, "All port owners owned by %016"PRIx64" identifier have removed\n", owner_id); -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:12.420618591 +0800 +++ 0239-ethdev-fix-crash-on-owner-delete.patch 2021-11-10 14:17:02.080744373 +0800 @@ -1 +1 @@ -From b7ade5d31a747fc044a9816b38814b47a6e1b201 Mon Sep 17 00:00:00 2001 +From ffe143c3a8ee84139231095668462f5051d38a79 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit b7ade5d31a747fc044a9816b38814b47a6e1b201 ] @@ -12 +14,0 @@ -Cc: stable@dpdk.org @@ -19 +21 @@ - lib/ethdev/rte_ethdev.c | 9 ++++++--- + lib/librte_ethdev/rte_ethdev.c | 9 ++++++--- @@ -22,5 +24,5 @@ -diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c -index 7db84b12d0..8e679e4003 100644 ---- a/lib/ethdev/rte_ethdev.c -+++ b/lib/ethdev/rte_ethdev.c -@@ -757,10 +757,13 @@ rte_eth_dev_owner_delete(const uint64_t owner_id) +diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c +index 9b695e1e1b..dd5ce4eb1a 100644 +--- a/lib/librte_ethdev/rte_ethdev.c ++++ b/lib/librte_ethdev/rte_ethdev.c +@@ -718,10 +718,13 @@ rte_eth_dev_owner_delete(const uint64_t owner_id)