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 BAF04470E5 for ; Thu, 25 Dec 2025 10:20:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B42404025E; Thu, 25 Dec 2025 10:20:49 +0100 (CET) Received: from CO1PR03CU002.outbound.protection.outlook.com (mail-westus2azon11010011.outbound.protection.outlook.com [52.101.46.11]) by mails.dpdk.org (Postfix) with ESMTP id 296BD40430 for ; Thu, 25 Dec 2025 10:20:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TTWXMVFXbWMCNmF/aNrWS+2FrFzkAqujQFL/w7j159cjwsrFGh+9Yib7ymYTykzIPke6HGVUlU8B3vCAlg9bJ5sw50ph58LnDF6TTxXhcVYBxidvaPO9ZC1XgP4RAt1osYazYevdmwMw4itYCdWVWJ5Yhi8P6ICoIf5feMiwO9NtcrAjEeSX5Ss22vFLclGnbkE72T6n4wVMomOXO5th13dCQcPmopvIh5CL2s8qY4udbsHC8SjLOnK7VamgHHUdgEmEka10gHbucgfuvIaQMSS1Gc0U/zuCmmedFFhDAxvj2bpjaw6cYTeOJNxr8CHpXTg0z5iLhIlgTM/rYcdNeg== 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=ERPQzBdBGr2z0VaYJgIFXjzgkNakU4VtOYBNzBA7MQg=; b=GRssEAyqc4dG3hyYWXPTea1CIx1Bg77OMFjbCuSf3Zjz/DPEqcqNv38zAWtFnWH5UQHDL8oFuPtF/XD/aQIPi+hDwJgupj/9zTgeXUWc193Hp8tBI/wUUBwrfpiHvIKd/sd49FMwKCIww9ra//kcprdPstP+Rbd/pQtWaXLPgrQUhQQBLutF16ra9lbfsN/ryZ42ew9+SpWKQJwOHATTfXT2NaO+tHtAG8GzDrCkwKTCV0oZhNfQihe2jOYcOdqSV/8t16gkCInfqZ0OvLjHEjQuxuls9PKL4WNgPAElO7V0tVL5F+p/9ye6ds2C4NBm4h0BkMnc6xPVzLBEppSLAg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=intel.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=ERPQzBdBGr2z0VaYJgIFXjzgkNakU4VtOYBNzBA7MQg=; b=XyhjkQpfY6kynNM+mvRx9xF1FSUp0s4Jo0Q19OTboaZTzTfWDtGMsT5jkxWURVWLQL6A8RTb9Bc6RuHI0glUeRunse6krHMXsNv8Zy+Z+I9v0hqUpP6Is3QxWLhOA8VWzQYniOEcKL8IfCaRFStKwPAqbg5sJUx3Cgs10nSJFwruiihfXaBQRpSorQoRNoNqrenwn6UIOYCvcstYMYvnSzwAlvT32/kbT9H4cOIASLeZkG/Juu9lUyvICPUU333tdXSMdr+1zGYd1kE9OmVpUYe6qN8J3H4mVBVLd7rfWmGv3aobH2c06AEmojtRSPHsf0Zga+oahqFhx6OVCLPj1Q== Received: from SJ0PR05CA0010.namprd05.prod.outlook.com (2603:10b6:a03:33b::15) by MW4PR12MB6779.namprd12.prod.outlook.com (2603:10b6:303:20f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9456.11; Thu, 25 Dec 2025 09:20:44 +0000 Received: from BY1PEPF0001AE19.namprd04.prod.outlook.com (2603:10b6:a03:33b:cafe::17) by SJ0PR05CA0010.outlook.office365.com (2603:10b6:a03:33b::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9456.5 via Frontend Transport; Thu, 25 Dec 2025 09:20:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by BY1PEPF0001AE19.mail.protection.outlook.com (10.167.242.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9456.9 via Frontend Transport; Thu, 25 Dec 2025 09:20:42 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 25 Dec 2025 01:20:32 -0800 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 25 Dec 2025 01:20:32 -0800 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Thu, 25 Dec 2025 01:20:31 -0800 From: Shani Peretz To: Anatoly Burakov CC: dpdk stable Subject: patch 'bus/pci: fix resource leak in secondary process' has been queued to stable release 23.11.6 Date: Thu, 25 Dec 2025 11:17:33 +0200 Message-ID: <20251225091938.345892-12-shperetz@nvidia.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251225091938.345892-1-shperetz@nvidia.com> References: <20251221145746.763179-93-shperetz@nvidia.com> <20251225091938.345892-1-shperetz@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY1PEPF0001AE19:EE_|MW4PR12MB6779:EE_ X-MS-Office365-Filtering-Correlation-Id: 396d01a7-9aaf-4a41-5699-08de4396e0db X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|36860700013|82310400026|7053199007|13003099007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Qfw0Qmt0BtDyki3hTPD5f4VVmW1FYFT5FkBb2ErOBMkW0dt5pOvUXRHUhmpa?= =?us-ascii?Q?W6VT1hmDoiMKcsZ2TrPzOQY7pOprjoQI8kbYDylEpfLsr7Ywxax5CednghPI?= =?us-ascii?Q?HuqcpSCSBLUJR6Bn6gYrJOvZw6Ki9nTdNx4g4O8N5YJQOxlciI3RZNQOTRFW?= =?us-ascii?Q?aiKI0k8M5vdRugUyQ470gJ42GxTYGJh1wjGOkvzBCF9P0G3uVGUN1bGt1kDv?= =?us-ascii?Q?Bv+d+WHhJvVRIqFyiIiDnwnHluCDgq2GHB1hIWVLhrgw+YpVbJRxDnrZFoOQ?= =?us-ascii?Q?nedn4rQqrgmE+o+DSBBdguNFArYZ9X72/X4l/j8vW595ZchtGc0vib16ucjn?= =?us-ascii?Q?V0nmn/scWzK4QegPgEMuaihOqrk/20vRtVmygHKmRi8vk4wPrA1F/wC0SRRP?= =?us-ascii?Q?epEw7CAAbgrMOvUNc+7o67zAbdV4PFvavibQbbWzY9cdhp+lVwm8ACJktQxH?= =?us-ascii?Q?e3ZaH3zEACfgZcYty08K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2THiaq9k?= =?us-ascii?Q?5LnwiG2I0+0jEoaQ9lAKzq+bh9+zwzEcujejmMNeTrFA0C3Wy5x1CUtK5d32?= =?us-ascii?Q?Jx54sZyabO9N1qMQI9UTb/vmg5oaskUmW04n5eMvff1res51jpr0/gViZtS0?= =?us-ascii?Q?AU0DmPCU7zAykL8stz+efZwWLZVZ48RoVHrK9DRHQHI4kVuGp5vUO4k2Ge47?= =?us-ascii?Q?F+kaQIP1dWEewczaEOQb73cSi5R/tBO1nsIwTDtk?= X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026)(7053199007)(13003099007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Dec 2025 09:20:42.9670 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 396d01a7-9aaf-4a41-5699-08de4396e0db X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BY1PEPF0001AE19.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6779 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.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/30/25. 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/shanipr/dpdk-stable This queued commit can be viewed at: https://github.com/shanipr/dpdk-stable/commit/d7af410e9a05e2d89f944bd623df6e605a853d64 Thanks. Shani --- >From d7af410e9a05e2d89f944bd623df6e605a853d64 Mon Sep 17 00:00:00 2001 From: Anatoly Burakov Date: Fri, 24 Oct 2025 10:18:24 +0100 Subject: [PATCH] bus/pci: fix resource leak in secondary process [ upstream commit 6ca08d36ba7310edfe96207b299f79221b7e2d37 ] Right after setting up VFIO device, we attempt to fill region information. This operation can fail, and if it does, we do not release the device fd. Fix the control flow to free the device fd if getting region info failed. Fixes: 4b741542ecde ("bus/pci: avoid depending on private kernel value") Signed-off-by: Anatoly Burakov --- drivers/bus/pci/linux/pci_vfio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index baa0b9d9b3..9341560fe5 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -970,7 +970,7 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev) char pci_addr[PATH_MAX] = {0}; int vfio_dev_fd; struct rte_pci_addr *loc = &dev->addr; - int i, j, ret; + int j, ret, i = 0; struct mapped_pci_resource *vfio_res = NULL; struct mapped_pci_res_list *vfio_res_list = RTE_TAILQ_CAST(rte_vfio_tailq.head, mapped_pci_res_list); @@ -1009,7 +1009,7 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev) ret = pci_vfio_fill_regions(dev, vfio_dev_fd, &device_info); if (ret) - return ret; + goto err_vfio_dev_fd; /* map BARs */ maps = vfio_res->maps; -- 2.43.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-12-25 11:16:36.972943113 +0200 +++ 0012-bus-pci-fix-resource-leak-in-secondary-process.patch 2025-12-25 11:16:35.352898000 +0200 @@ -1 +1 @@ -From 6ca08d36ba7310edfe96207b299f79221b7e2d37 Mon Sep 17 00:00:00 2001 +From d7af410e9a05e2d89f944bd623df6e605a853d64 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 6ca08d36ba7310edfe96207b299f79221b7e2d37 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -19 +20 @@ -index c63721dd61..8562fdcc6b 100644 +index baa0b9d9b3..9341560fe5 100644 @@ -22 +23 @@ -@@ -932,7 +932,7 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev) +@@ -970,7 +970,7 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev) @@ -31 +32 @@ -@@ -968,7 +968,7 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev) +@@ -1009,7 +1009,7 @@ pci_vfio_map_resource_secondary(struct rte_pci_device *dev)