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 310AA45CE3 for ; Mon, 11 Nov 2024 07:32:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 28F3540685; Mon, 11 Nov 2024 07:32:17 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2080.outbound.protection.outlook.com [40.107.236.80]) by mails.dpdk.org (Postfix) with ESMTP id 452C440E1E for ; Mon, 11 Nov 2024 07:32:16 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bdqQ4qXWXiGD6OWtR0Du9rgtTg+rTRkQbCXoThy+/hCIlDj+1rtiA5Q92Eq5+qrQ3rOUSpPDRSZ20UfFDmIY1i93h5BthENhiyN5oiyX9DfWUb4iK3iYJ7f9uGuSbiCNrKvf51mqYkklbqbNxMItl0zbrw1626hZqxis0J4jrfBacHuc9t0U1dWs9e96rVBVsOG9vUl7DbxybohBNdgKLuM8eQeX88oFd+1tuPpFTvfh3JJCUSrJOSiz92wxAE1wMrfyhyuyp2/usiGqGtwMQSCfWLMZbg16OUP5h9pDYFVWbQf1I4TgcoBsltfLodRUDnywUzf1FgWRAvCwbqCQFQ== 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=bbf0/KrG5pHMm25LqTNPz9VVoMCOtGZ8lKGMH2+KT2A=; b=kO3AkmFsYMwP4FQuor5bnV7TbKgGbPR8tV+hxbV4fHqxGD1eIJbn9mqWbbhrXkRgUrBjgXhyG2DjT6LkthhQc2IbBnmhOkknCXzdQ/EOToRU0yvScJMUD8bEr0BLBAL0zLQZn3UTH0u2uPz3oaMzXhzYxQ2nTzYJ8d+nlGXW7iaQQyqhx16R+6C4JzlyyqIS6o+ThgwnSClICdhsS0Ed3Sqbb6LToYqmonFsvj526dQg7d8OS38nFL+e9dRY1tsYV7v1zPovjaCNWHEmrZwmWP8/DiXf4r3LJmq+ChU7gUZ0P6OwY4klKV80SrxA7Oy2BHwqtuxDiTNlgn/lRtNcig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=monjalon.net 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=bbf0/KrG5pHMm25LqTNPz9VVoMCOtGZ8lKGMH2+KT2A=; b=TXWnH1fWLiu17AL4rpZwjbi/BXeaeBlJpM+B5Tt5kU5F6i3KCni/a41+p+5AJkvUEyEJf/qvoQX+kgB0qUwj9kv1W8L13jvKTUwMD+CkR75/Vta+jw38XHO/xQWmQ6NXyeYbZwhwNVKxBM0Ib08hBY+C1RuxFA4pCtt3XbxVzbg6tTmjZf1EdjonuBUtDo6U41bQOsoDEQY7DqqYF+iSizx0Sd+gs6rbVlT2mFmrWHBvP152Qv2eyBUfmb6ZY9hbPqRQmiZ0Ec3uL5jT0VL9qxHZvIs5jays4YhWLbr31RVbVVK+BiL67ge7AZENEvlxsQ/fnT0vvDbJtMD4uAihCw== Received: from BL0PR01CA0022.prod.exchangelabs.com (2603:10b6:208:71::35) by MW6PR12MB8663.namprd12.prod.outlook.com (2603:10b6:303:240::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.25; Mon, 11 Nov 2024 06:32:12 +0000 Received: from BN2PEPF000055DE.namprd21.prod.outlook.com (2603:10b6:208:71:cafe::54) by BL0PR01CA0022.outlook.office365.com (2603:10b6:208:71::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.27 via Frontend Transport; Mon, 11 Nov 2024 06:32:12 +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 BN2PEPF000055DE.mail.protection.outlook.com (10.167.245.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.1 via Frontend Transport; Mon, 11 Nov 2024 06:32:11 +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.1544.4; Sun, 10 Nov 2024 22:31:58 -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:31:56 -0800 From: Xueming Li To: Thomas Monjalon CC: , David Marchand , "dpdk stable" Subject: patch 'net/nfb: fix use after free' has been queued to stable release 23.11.3 Date: Mon, 11 Nov 2024 14:27:14 +0800 Message-ID: <20241111062847.216344-29-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-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: BN2PEPF000055DE:EE_|MW6PR12MB8663:EE_ X-MS-Office365-Filtering-Correlation-Id: 585192b5-7cbc-4b95-4cb1-08dd021a932b X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?/xZvMxciI8d8HKwUtpcnjlkFHm21Rzwfg9jHnBoeSVaYEre5hlR7DAmGJMoC?= =?us-ascii?Q?qjGm3Hvqpk8zzocRkjVqtjCtUpZSTg3MsrJDZMBOrQb7gAHo7LY3/bcbutjx?= =?us-ascii?Q?llRDzLBc/8VGJyDkW59klcgqSsA+Dcja/vv12id/TCpGsGE+YJx2acsW3J8h?= =?us-ascii?Q?3Asta7HxiESp1WIf647U5WpVDxdKnhe6iJJVzdlPNKaGUY5i52jhmXqWrKDL?= =?us-ascii?Q?kKlzw2CNAFPEBVKCSXi3v4upL8+RV7rPTWUfRFe3FhXYTcJWneWso/2tZNp7?= =?us-ascii?Q?UqJb1NCABh8lwvnqVY75wEIktO6IUmBmhfAx6OY9n1aN+o/lZHH+LrPgOmje?= =?us-ascii?Q?Fxx5cNJpgNlokj710I9MXwUbwcZR/mvP4ogZ4h4fwjX9xXYhCJAwYwiOu7sO?= =?us-ascii?Q?qFjuOW9RDz7v3DLostF2+C5feY7zgAWzWx8MZSJl+GkjxCfCYd3ntmXjPesL?= =?us-ascii?Q?pYn8rvDo9W4OYG1wJQVcluYFP438+z0T1nD74ybGtzqWnW/04re6fpsRSLrD?= =?us-ascii?Q?fegFVnRKb9RO057BDEh/xZYAcsDGYI5cyWH59VW8crLPd1Pw3t9H0j3JvbWr?= =?us-ascii?Q?4DITV2d59JzHhNCpGuqKBcEY/h/aoY91EZXWZClIfY8vGCw9EFv8P8xfcs4N?= =?us-ascii?Q?FJofLHl8qN83lNleLhxcwfpbRjiYCYpff5Fomh1aCxfZwjjJYozOatAgArtR?= =?us-ascii?Q?RugivpXEmehYaxUmRzfeezJg5jkCCbToA7UQ2QiQHgm2/Coit6sK1777XCu0?= =?us-ascii?Q?bfNjozAbANNZ0HIbii474/stS+LCrCHHuljvSHo7hwjd9UqSp8oIDBpmstbT?= =?us-ascii?Q?pzGz3Te6ZXQolqvDKpnhE8Ojr7+Sk/cKBdUuk8VDPl8LYYnsvH3SW/MDXUNU?= =?us-ascii?Q?kE19TGYYrGhPWK/Lbt5aWgtkfIX2XeCIYeTEp/tc1e8HdLE5wSIb5oM95qcn?= =?us-ascii?Q?C95SCk5XxY394AnPNbiE88Kz30F6RkAUz1VgW6QldtuVWMKI2N6UhWD8sdXN?= =?us-ascii?Q?2fHI20vl0hEqbqnpfiplG1eR6uT6jwPevlXL+LISVdCBx4Fbpcer2T7Rn2gC?= =?us-ascii?Q?6ub/0+0VWtfuLK8peJ3swFGHmIvptVQnNcshFmutURWm2jqawRA3KInj+dPk?= =?us-ascii?Q?B4iEHwE7HXwTy4bkjv8CV/kzSZsTRns3qaEu7y/LHKOgskKSqMrga49PW6UA?= =?us-ascii?Q?HUNKfLYYmJnBRD7o/qaT03UPuKKfcBgTXAtZyeMSfb1xkJGbOb+Q8n5Z4HNs?= =?us-ascii?Q?E7oH/KiUnOG+yej1Je2VoIb/cW6mIaDbfVsIu8P63urKM0zb9C0m9LoTxE7l?= =?us-ascii?Q?OcQNBStyvlv2VZD05w+jaAobdVqQueJAztYq1T4doK1yNwWUbRclrms2Gk+v?= =?us-ascii?Q?lJF7J1D3LY8rkZcTCmTriPnDo4KOfC57cLSyY0zhXBHQcWJmMQ=3D=3D?= 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:(13230040)(36860700013)(82310400026)(1800799024)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 06:32:11.5784 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 585192b5-7cbc-4b95-4cb1-08dd021a932b 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: BN2PEPF000055DE.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8663 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=5facb377a447b0150f17cf19b1d2ab006f721a03 Thanks. Xueming Li --- >From 5facb377a447b0150f17cf19b1d2ab006f721a03 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Thu, 10 Oct 2024 19:11:07 +0200 Subject: [PATCH] net/nfb: fix use after free Cc: Xueming Li [ upstream commit 76da9834ebb6e43e005bd5895ff4568d0e7be78f ] With the annotations added to the allocation functions in commit 80da7efbb4c4 ("eal: annotate allocation functions"), more issues are detected at compilation time: nfb_rx.c:133:28: error: pointer 'rxq' used after 'rte_free' It is fixed by moving the assignment before freeing the parent pointer. Fixes: 6435f9a0ac22 ("net/nfb: add new netcope driver") Signed-off-by: Thomas Monjalon Reviewed-by: David Marchand --- drivers/net/nfb/nfb_rx.c | 2 +- drivers/net/nfb/nfb_tx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfb/nfb_rx.c b/drivers/net/nfb/nfb_rx.c index 8a9b232305..7941197b77 100644 --- a/drivers/net/nfb/nfb_rx.c +++ b/drivers/net/nfb/nfb_rx.c @@ -129,7 +129,7 @@ nfb_eth_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid) if (rxq->queue != NULL) { ndp_close_rx_queue(rxq->queue); - rte_free(rxq); rxq->queue = NULL; + rte_free(rxq); } } diff --git a/drivers/net/nfb/nfb_tx.c b/drivers/net/nfb/nfb_tx.c index d49fc324e7..5c38d69934 100644 --- a/drivers/net/nfb/nfb_tx.c +++ b/drivers/net/nfb/nfb_tx.c @@ -108,7 +108,7 @@ nfb_eth_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid) if (txq->queue != NULL) { ndp_close_tx_queue(txq->queue); - rte_free(txq); txq->queue = NULL; + rte_free(txq); } } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-11 14:23:06.621227709 +0800 +++ 0028-net-nfb-fix-use-after-free.patch 2024-11-11 14:23:05.062192841 +0800 @@ -1 +1 @@ -From 76da9834ebb6e43e005bd5895ff4568d0e7be78f Mon Sep 17 00:00:00 2001 +From 5facb377a447b0150f17cf19b1d2ab006f721a03 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 76da9834ebb6e43e005bd5895ff4568d0e7be78f ] @@ -15 +17,0 @@ -Cc: stable@dpdk.org @@ -25 +27 @@ -index f72afafe8f..462bc3b50d 100644 +index 8a9b232305..7941197b77 100644 @@ -38 +40 @@ -index a1318a4205..cf99268c43 100644 +index d49fc324e7..5c38d69934 100644