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 32F3E45CE3 for ; Mon, 11 Nov 2024 07:30:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B4864067A; Mon, 11 Nov 2024 07:30:58 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2045.outbound.protection.outlook.com [40.107.244.45]) by mails.dpdk.org (Postfix) with ESMTP id 15D1D4067A for ; Mon, 11 Nov 2024 07:30:57 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=THqdKdEOSJ+jrYWXVPFdXldYAV7SfD4QyCY1xjpZbDDT5vtqDWo2aV1je6s9LTOBhQdcCKI6TIAoATM7oGGT3M7iN8KPTB+cebtz8Yg4A64r43ezXItW5yL8J7zGlTojzlPsTa9xBmjiuH94yUs6qk70e88Est4GG4MqRqCcjWk5nzCjRwGDU7mD57PwoWEQEpqfBpC6BvDRyWJ8PwEMCUQ1pSQr93R4PGniIOHJwI5JIjIzcwsHuHMsMVTQ2JAUfwWc7rPwjzAFKkfomHUkNPM4oawNwixUf9CNU8XgCa2XuhkW21H6DvVd8O8yqd7labF3+/jo5wh5PrN0bMfy1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=yAuK4WwfcbuoiOML+2BUvIEmiUpM8Eo+XRh+F2o/t2A=; b=YCRwThbbMHJWEnKkmvOZ0LCPAK2AdRyFzqhafPSoLBrl6p8aWFvi7HRUu1yeCQiPQ3vsy5PrJPSiWoRIMI2Zv55Ln8+8tM188eDlrRxNjec+1yg/+Bx7WPRRPAk2uJMwAqyLe5KEjNcVdcO3wuNUNg/Am6MR1jHIureru8UAbHOT5wsq0+w2FUZLIH9wk/G8NvWlCgXftooKPB67M6GyiF5QTHeYob/Z3bbtwLRuhOEl3MgZn++amweFfseh7zC1lwyocoz55pSTuiip7Ohvy7atO5rWWpTAIGeziPcH3Mixys4EKecN84aarwn37W9VimQWgeFo+MMEKuozrdtiPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=networkplumber.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 (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=yAuK4WwfcbuoiOML+2BUvIEmiUpM8Eo+XRh+F2o/t2A=; b=PxvG8rnZAqEInb5DNLa5VORfnNact7/eI4Lg1LwVA4aKm+A2zeELpYPTPImlEF2h7XdU1nAcLCYWzuebE+cYTkSFi1Ioa7y83arjjKzY63oRDEn87M3Y9Z2AQpasYADQ2gw+571KqHSvo7G4klnHfGU9iZfqdq2g5QmYf2wkDRqHiqlg0rb/klJDXkkredbHhqrD4KnpN+0YL0QsErwnAtt7P7hOhfaGHe63ZJxfHap1pVdjTvj4fFqmr22daVWROga3nwxCd7WSuDiVg2tGD6SmrDIFjT81hucYTyZjLgxEAVQuXeJBZduFA1YbpnE8Y2y2EClVhLP8dGLaLz3xMQ== Received: from DS7PR05CA0090.namprd05.prod.outlook.com (2603:10b6:8:56::13) by IA0PR12MB8373.namprd12.prod.outlook.com (2603:10b6:208:40d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.22; Mon, 11 Nov 2024 06:30:53 +0000 Received: from DS1PEPF00017092.namprd03.prod.outlook.com (2603:10b6:8:56:cafe::6) by DS7PR05CA0090.outlook.office365.com (2603:10b6:8:56::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.14 via Frontend Transport; Mon, 11 Nov 2024 06:30:53 +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 DS1PEPF00017092.mail.protection.outlook.com (10.167.17.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.14 via Frontend Transport; Mon, 11 Nov 2024 06:30:53 +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.1544.4; Sun, 10 Nov 2024 22:30:42 -0800 Received: from nvidia.com (10.126.231.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.1544.4; Sun, 10 Nov 2024 22:30:40 -0800 From: Xueming Li To: Stephen Hemminger CC: , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Konstantin Ananyev , Wathsala Vithanage , dpdk stable Subject: patch 'common/qat: fix use after free in device probe' has been queued to stable release 23.11.3 Date: Mon, 11 Nov 2024 14:27:01 +0800 Message-ID: <20241111062847.216344-16-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241111062847.216344-1-xuemingl@nvidia.com> References: <20241111062847.216344-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017092:EE_|IA0PR12MB8373:EE_ X-MS-Office365-Filtering-Correlation-Id: 011e6970-bf54-48c1-4348-08dd021a647f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?utf-8?B?aXJ3TlQyaytIdzNyUWM2b0FCdEx4UnhIRThCT0pHOGJLU3B4NGQzVUo3c3Mx?= =?utf-8?B?cVlqTFJhbHMvVWZmeXgrTFc2OCt5WjZMMlJudk9JalplalN6aHU0YkJUL0NG?= =?utf-8?B?UHRDS1JocndxNzNFWlpuU3hrbHJSNDYvNThTcTd6YUxEWVprRXp3N1p0aHlU?= =?utf-8?B?TFRyalA0eTBia1RTaHdpSk9TZ3FCUCttMVFhK0pSMElSdHlwdWsrWVB2NWxw?= =?utf-8?B?YlV0aXo3cGMxLzQ4RzB4TmRSdXdlZVlHL1dLUUtyZ29wemVqMmlVRE1zdU1Q?= =?utf-8?B?OVVDTEJ0Ly94QnBONGxjRFowTGN5dWtucXIxMEs4aGVtV1habXRXdldDOW83?= =?utf-8?B?Nml4eWRPVGlvT0k0VVNTTmxXbXl6TGhJK3A2UjdnMGlLWUFwRGQ3UmJFNHgv?= =?utf-8?B?cis3MVZ4NlpuaGF1N0l0T2ZwMXQ3Nm1rS2hrbUhnTVVCUk1JNnBrc0hodUhx?= =?utf-8?B?RGNQeVdnc1l4USsrQ2Vkc2tSWkQ1NEV5NHRUWEdhbFdVL1NvUWxxeGRTWTVV?= =?utf-8?B?eU5qZUljZFc4ZHR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VTnJWbWh1?= =?utf-8?B?anh5R0k4eUVLdk9ITjBMMStpN2RpN09LR2dLeCtGNllMYlpLaDZrREVzaThn?= =?utf-8?B?Sk5tNE9IUVpzd1JsMC9lYzlaQm9OWEFKT2UzN2RVbnlSZTUwdmhHTkFvVy9K?= =?utf-8?B?MDZoN0Y2NG4waFYrVTdLb2F3ZDFjb3hLeVdXUmU0WDV2S2tNYTBtb1dQVUUv?= =?utf-8?B?aytudE40cnl1S3h5UGFndXJhMUhqOFBVd28wZ3NhS2xJWlpQMVFIbzhLaFpx?= =?utf-8?B?aUoxQ2ZUdjRybDI4RFowVWR0Z21yWFF5VTFsbFNTUWdYN29ja2R5dXlkY1ZW?= =?utf-8?B?S3FyQXBZUWpzS2RlMjJmdlh0aXZjMTJ0WGtHOTd5OHNuMWIva0wyUjNyOTh6?= =?utf-8?B?UU5QZjdpSGFibnptZlFoZnNWU2NmSjdEcW5vcnArZm44UmNLUUEvUkFlSHZV?= =?utf-8?B?ano2UTAyZ21tK20zWTM2RDdsbzNVbnJDUUtsMWEvQmVPNFE9PQ==?= 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:(13230040)(1800799024)(36860700013)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 06:30:53.3383 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 011e6970-bf54-48c1-4348-08dd021a647f 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: DS1PEPF00017092.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8373 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.3 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/30/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=67197a5768eb0b2579058cbf1862eba4c43537aa Thanks. Xueming Li --- >From 67197a5768eb0b2579058cbf1862eba4c43537aa Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 8 Oct 2024 09:47:17 -0700 Subject: [PATCH] common/qat: fix use after free in device probe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Xueming Li [ upstream commit 1af60a8ce25a4a1a2ae1da6c00f432ce89a4c2eb ] Checking return value of rte_memzone_free() is pointless and if it failed then it was because the pointer was null. Fixes: 7b1374b1e6e7 ("common/qat: limit configuration to primary process") Signed-off-by: Stephen Hemminger Acked-by: Morten Brørup Acked-by: Konstantin Ananyev Acked-by: Wathsala Vithanage --- drivers/common/qat/qat_device.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c index eceb5c89c4..6901fb3aab 100644 --- a/drivers/common/qat/qat_device.c +++ b/drivers/common/qat/qat_device.c @@ -335,11 +335,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev, return qat_dev; error: - if (rte_memzone_free(qat_dev_mz)) { - QAT_LOG(DEBUG, - "QAT internal error! Trying to free already allocated memzone: %s", - qat_dev_mz->name); - } + rte_memzone_free(qat_dev_mz); return NULL; } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-11 14:23:06.137913819 +0800 +++ 0015-common-qat-fix-use-after-free-in-device-probe.patch 2024-11-11 14:23:05.032192841 +0800 @@ -1 +1 @@ -From 1af60a8ce25a4a1a2ae1da6c00f432ce89a4c2eb Mon Sep 17 00:00:00 2001 +From 67197a5768eb0b2579058cbf1862eba4c43537aa Mon Sep 17 00:00:00 2001 @@ -7,0 +8,3 @@ +Cc: Xueming Li + +[ upstream commit 1af60a8ce25a4a1a2ae1da6c00f432ce89a4c2eb ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org @@ -24 +26 @@ -index 4a972a83bd..bca88fd9bd 100644 +index eceb5c89c4..6901fb3aab 100644 @@ -27 +29,2 @@ -@@ -390,11 +390,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev) +@@ -335,11 +335,7 @@ qat_pci_device_allocate(struct rte_pci_device *pci_dev, + @@ -30 +32,0 @@ - rte_free(qat_dev->command_line);