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 0753543B86 for ; Tue, 5 Mar 2024 10:49:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EFF4B410F9; Tue, 5 Mar 2024 10:49:37 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2042.outbound.protection.outlook.com [40.107.243.42]) by mails.dpdk.org (Postfix) with ESMTP id 5BD394014F for ; Tue, 5 Mar 2024 10:49:36 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M8bLUJs+RtDxvQd2oGrW2egFFDfkxfCd/LDOXXmQHMpyT173csSM4OykfTW/Du6KEGWPMlWdN5jaFHBXP4uOwvUVjKiKZKp1T3931q2RTkKmgRMag0DbFenHfVuOamF3d6qpXpk8RxKWqtVFEpsA4YlIPHVFV1Ed7HEgXKNGUMt/TF4FYckUrEXV5yNfV5fsioncrF0B9glzl35S7wag3Mx1e68lSZdAkzB8hjvdTIszBRsLvUNb8nr+zPoflapii1X00pPzaynHe6WERjCLJ8xOtZDCKkzi+4pKPO8cLgk9+f0K5+xVrnYXhcHuAPYtx6UIkSJv4LfHnlmzlAECTw== 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=6NqqyRhnSqx9W0v9Q0vfGI+bxIVzz3TW11LFgrZMdNw=; b=Kup9KEQ5HwTUfUuR/RQ10Fp1VKYf96DLeOKKBvMxBpoMgjL8bT0hUWMfLDwWdE3NkV8x9ShNRPWwEDMdxOtnmp+XutzExTGZkJ2ZYDOAoybhhNn8OY1P+qmNVajRnoozk8Z2sr9nsZx8QPLfubIf5c/xnHpcgmubjdLCJhOJWenlRKniRhprnClAHF0UfM5lUvFKtbOQuw9xt/EEOjuizohP642obzEVzhMlrKe6lBlilDTDKR1Mt7OAB7vItmmJ5Iq5uvjybRQ4/G9mSGaiy3ttu9vtgMkwme6Re+1jg9U/5jEBTBnPdFfb/6fL2ckWTodrNlp0l1bYGmxRpO/2kw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=huawei.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=6NqqyRhnSqx9W0v9Q0vfGI+bxIVzz3TW11LFgrZMdNw=; b=XB9eHYaaB3ua4H7aoCpShqb19/85oXVGrs6iLlkRh4efzQw8i0OFcjwgG78TiqSYhKP6y9vHPrj4/viX0e56lsXUChJ+S2hHOinhSYFNngNE64pqhzK7uQd0XD2y8T5XlXJ2D/GAolgLEyV/U4HplBysVnK7JJV56Anwkn6c09d1JUAI7j3F6ThmE2kzSJO7H8UsoNXNkX3K9lldyjrsYRGRS8FFnkNvus3Vr9z64nEkCCRXDkXzbE6mU6kkx7o8K7Dg4ptkTjnbbcK0BI10o0v12fR2iF7mpNCnebt7e/C3TqOWMtO28yqnDRriZYEdOfegLecgKattNkbWwgW/UQ== Received: from SA0PR11CA0174.namprd11.prod.outlook.com (2603:10b6:806:1bb::29) by BY5PR12MB4228.namprd12.prod.outlook.com (2603:10b6:a03:20b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39; Tue, 5 Mar 2024 09:49:31 +0000 Received: from SN1PEPF0002BA4D.namprd03.prod.outlook.com (2603:10b6:806:1bb:cafe::8a) by SA0PR11CA0174.outlook.office365.com (2603:10b6:806:1bb::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.38 via Frontend Transport; Tue, 5 Mar 2024 09:49:31 +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 SN1PEPF0002BA4D.mail.protection.outlook.com (10.167.242.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Tue, 5 Mar 2024 09:49:31 +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.41; Tue, 5 Mar 2024 01:49:11 -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.1258.12; Tue, 5 Mar 2024 01:49:10 -0800 From: Xueming Li To: Yunjian Wang CC: Qi Zhang , dpdk stable Subject: patch 'net/ixgbe: fix memoy leak after device init failure' has been queued to stable release 23.11.1 Date: Tue, 5 Mar 2024 17:45:52 +0800 Message-ID: <20240305094757.439387-12-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240305094757.439387-1-xuemingl@nvidia.com> References: <20240305094757.439387-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: SN1PEPF0002BA4D:EE_|BY5PR12MB4228:EE_ X-MS-Office365-Filtering-Correlation-Id: 3713c642-4782-42a9-022c-08dc3cf98e8b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5r8CHEgr4kgfxt/SQvV1gfbcp9CDDkidDkoNqOKGpEEuBLq8cKpjrVWlQo+Gh6BNzeY8zkLm4wHwP59O59Quek0D/EakE38RoUiPMUe9Y5PNL/yANVOKTpjwaHxjUy0Y7YSAJJXaNte98Zcq03zx80W2y2Laax9PyqQpLI8OSddc6lBKEcF5aVZpRO5IwN55XGYZe+4q9xKjycy5CuDHqZv0joU7MQOMynGzXLnCW5bdn3DchL62IxaZXttacJhNlDsodujLVBgpCBTa6dSLjOzZXZoxaVrPDkfv4KFpocstc/ApBfUZtM6qqppEayxCAozznygkPOMaL3Ts/eGeTa2Albz+ZyQMAw2Deu0nRnRMaTCSck3JWgehXrUUJ3TttVLmCzwADCAqBmfl9zvRi+rfbnV1D17IIZhDdul1cqaKD0IGSjE8JKSzpMCZfqTje8r+B88jmDAlgDTnXD6I71LOD2OKXWNpxDq20GXELmtrtM9MgqYUfONRzryWBc/dsOwO4OMqDIlYvbrBTPoC2SvkPsrzHfgDwOCz4xA6EyHCxa1S7w/qOB7d/b95+NBUgmTWiuPhuPeNzH2K3cH//1LCd2fY/EcmtBZeR8ehbLZeNh/mXkx/2dMu1jQ+x44Bl6BHuYWpCnbv4m0cRmHqSMF9qTZJo0dawp3eKYFZU7EgLAf2VUrxOqvBaQY9IJ2mQ/hC+uXNmA8+x4tV5TnOzBHoGEyeefabYV7+qgih4jewO9uBk9kOWMukJxO8Efej 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:(13230031)(36860700004)(82310400014)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2024 09:49:31.4515 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3713c642-4782-42a9-022c-08dc3cf98e8b 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: SN1PEPF0002BA4D.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4228 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 03/31/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=c655f20c8f5e55b625dd8f69036d699b821ef3b2 Thanks. Xueming Li --- >From c655f20c8f5e55b625dd8f69036d699b821ef3b2 Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Thu, 14 Dec 2023 14:44:41 +0800 Subject: [PATCH] net/ixgbe: fix memoy leak after device init failure Cc: Xueming Li [ upstream commit 4d70ae0f1bb88e2aa100f5f7bf50b6484f0685cd ] In ixgbe_ipsec_ctx_create() allocated memory for the 'security_ctx', we should free it when errors occur, otherwise it will lead to memory leak. Fixes: 9a0752f498d2 ("net/ixgbe: enable inline IPsec") Signed-off-by: Yunjian Wang Acked-by: Qi Zhang --- drivers/net/ixgbe/ixgbe_ethdev.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index d6cf00317e..a32d3a6d7c 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -1190,7 +1190,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) diag = ixgbe_validate_eeprom_checksum(hw, &csum); if (diag != IXGBE_SUCCESS) { PMD_INIT_LOG(ERR, "The EEPROM checksum is not valid: %d", diag); - return -EIO; + ret = -EIO; + goto err_exit; } #ifdef RTE_LIBRTE_IXGBE_BYPASS @@ -1228,7 +1229,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) PMD_INIT_LOG(ERR, "Unsupported SFP+ Module"); if (diag) { PMD_INIT_LOG(ERR, "Hardware Initialization Failure: %d", diag); - return -EIO; + ret = -EIO; + goto err_exit; } /* Reset the hw statistics */ @@ -1248,7 +1250,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) "Failed to allocate %u bytes needed to store " "MAC addresses", RTE_ETHER_ADDR_LEN * hw->mac.num_rar_entries); - return -ENOMEM; + ret = -ENOMEM; + goto err_exit; } /* Copy the permanent MAC address */ rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.perm_addr, @@ -1263,7 +1266,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) RTE_ETHER_ADDR_LEN * IXGBE_VMDQ_NUM_UC_MAC); rte_free(eth_dev->data->mac_addrs); eth_dev->data->mac_addrs = NULL; - return -ENOMEM; + ret = -ENOMEM; + goto err_exit; } /* initialize the vfta */ @@ -1347,6 +1351,11 @@ err_pf_host_init: eth_dev->data->mac_addrs = NULL; rte_free(eth_dev->data->hash_mac_addrs); eth_dev->data->hash_mac_addrs = NULL; +err_exit: +#ifdef RTE_LIB_SECURITY + rte_free(eth_dev->security_ctx); + eth_dev->security_ctx = NULL; +#endif return ret; } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-05 17:39:31.451848416 +0800 +++ 0011-net-ixgbe-fix-memoy-leak-after-device-init-failure.patch 2024-03-05 17:39:30.673566490 +0800 @@ -1 +1 @@ -From 4d70ae0f1bb88e2aa100f5f7bf50b6484f0685cd Mon Sep 17 00:00:00 2001 +From c655f20c8f5e55b625dd8f69036d699b821ef3b2 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 4d70ae0f1bb88e2aa100f5f7bf50b6484f0685cd ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org