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 8F53145CE3 for ; Mon, 11 Nov 2024 07:32:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 781D040685; Mon, 11 Nov 2024 07:32:04 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2072.outbound.protection.outlook.com [40.107.243.72]) by mails.dpdk.org (Postfix) with ESMTP id C73BF40E09 for ; Mon, 11 Nov 2024 07:32:02 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=afBcxOvka+ogzYslUDsOiFRyldykAskCn87RmUO/4YE+1IgoASUEOlJKcdWplTvqlEytlNC9PbWlLnRWGH5wZYnO9ZyNA/dgITHxZ9B+aeFvR2Wm9OTETaKjlpWbnvAzU2SbJ7pDJ9iovia6O0ozawA56Eha4D2FbaXgrQNTl11It5TDV30PBYcUAhdQyvuJTakgGhjbyUnfhR+6RPVCK9RgyBlKWAaSXJ+n5xnEiT+ZfTTZs430zU5cPGOKeXFCo1TWcU1wx+mei/v5eE8WyeYnH19iAOwdJZdl0bHi9EQkK2TEh5OHUDZ3krH0IiP5orJivkM0F+vKffEhayuNbw== 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=Q9HCTGVv5HtKfOerArw6gPjPoRrxlMYKggdixEfE2v4=; b=pTeuDXKM+qkv9l4U9sn8yfiivASnueoFXOuSNXzROkDVKWOpObw0Hk6AYIOBAKZVGX02r5CDNZHARuCBr3hMJMRp3/bMLU6dULmJlF5c8gWsUnad5Ia2oFLBj0NZrkWDoOHkZy56q8vMjTKODXZuShix01Wq3XgHWClKTUfCV8SLpxC2+yn1miTpZi88KanwgCgbttYsknQh2JvyMsQX7CpnaQvUWkwUb0Y+yOEMtxMyaxDhJdhlsmKgc/1l8viy5XbwihkICB08VkqUA6PCwe1OgcSaQmrjycV6Zg0A7Xpa9XhQu6Ixj/h8d3rpPwjn7LM/En+fGOqH4OFzSIv2Nw== 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=Q9HCTGVv5HtKfOerArw6gPjPoRrxlMYKggdixEfE2v4=; b=X91K6ClxmLjil2DczBguIFgQwo/I2ZedPdsDtDoOdKnyUsdC0kM2xVQc8b77vHfAwn9rhnWFAH1PxGKrsS8VH3EJR0s6KyKFTTgS+L3QJ4zhpauJ+dS7t+0ro9r2qCvSRR6Dc60z2/KORehtOmIezAP7CuxFo560m3gBhU3cOfqUWbQhTtPi+dTmnnnAoqLWedki8wA/ms8jnntGciWcDsJfwLFXdXpO/r5sRVTPRc6U+fBwZxTh1okOu4ZV6WgbR90Dkvn7OM1Z3aEbwUljnv64CJS7vi0DkE/2qJ2w2dOstRHEN7lE+QcejANlsvCmrmyfwFoTw4UiAsA4rwrFag== Received: from DS7PR03CA0185.namprd03.prod.outlook.com (2603:10b6:5:3b6::10) by MN0PR12MB5908.namprd12.prod.outlook.com (2603:10b6:208:37c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.26; Mon, 11 Nov 2024 06:32:00 +0000 Received: from DS1PEPF00017093.namprd03.prod.outlook.com (2603:10b6:5:3b6:cafe::5b) by DS7PR03CA0185.outlook.office365.com (2603:10b6:5:3b6::10) 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:31:59 +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 DS1PEPF00017093.mail.protection.outlook.com (10.167.17.136) 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:31:59 +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:31:49 -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:47 -0800 From: Xueming Li To: Stephen Hemminger CC: , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Konstantin Ananyev , Wathsala Vithanage , dpdk stable Subject: patch 'raw/ifpga/base: fix use after free' has been queued to stable release 23.11.3 Date: Mon, 11 Nov 2024 14:27:11 +0800 Message-ID: <20241111062847.216344-26-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: DS1PEPF00017093:EE_|MN0PR12MB5908:EE_ X-MS-Office365-Filtering-Correlation-Id: 39c89255-f442-4a66-e373-08dd021a8bf5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?MlZuWElTSXpmV2dRVURFeExSWjMxRXljY0pKRkNOMy95RGE5Tzc3bStSWkwz?= =?utf-8?B?S1A3a3c5eXdiWE82bG5FamlYZ2IveXdpZXRPdmwrSzA3VzlNV2plL0JWeWRO?= =?utf-8?B?bVF4YzhaVVgyMTVYTTlXcng4NWswMDRob21Jdk9HeGEzK0swSDEwZ3IxSDJB?= =?utf-8?B?ZHNaMXQwZDRycWJMZit0aTRIVElYMEcvUFBwbnBMVVV5clNRaWRDYU91bHh3?= =?utf-8?B?S2pqd1Fsc2FpMXBKSzl5NnhCU3VZZk1hM2F6bmdTaGFhdWFmSHN1QjY0VWph?= =?utf-8?B?NWJsUUJzNGFUZmYvVVdDSkoyU0VwMWRwMFRib05zMHhHVFJkQ1E0clhDc1Vi?= =?utf-8?B?RUo1ek12NVRob0JwbjBBYi9pc3pRVmVDcjNncHNKUndabkpHNXRlRzd3V2VP?= =?utf-8?B?OWFDTi9aWWMzU1NtU29TRFhlb0JYMncrRURxZ1RsZkZWaEFkakdxVSs2aG10?= =?utf-8?B?Q29YU1VmQ1c1RjMxNFNaT0xkdUFwUTcxd00rNzBCM0Jpc25ETWRLR05SektP?= =?utf-8?B?OVBVdTFSMlRhZ2J6cmFHeEdwNj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B?Y25jcVNPQ05CVFBzeTBTMnJEekY3K0hCcXZiTk9ySnNTTU1jbXZPZmF1Rm5R?= =?utf-8?B?TkFXaitDSTV5cWpPVVZ5SXdOdzhaRUVhMmQySU1ZeFVYdCtJVHB3cFlmVDFS?= =?utf-8?B?V3M4RndiYzUrejZUbWwvalpYVjVlcC9vNHdJWkFYZDhvMm8vQS9uMGdUT3p4?= =?utf-8?B?RVVDK0srM0FtSjI2MlZ4RVRmWk9DMTJMS09oYy9UUjBXWUF3NTQwR20wcEZX?= =?utf-8?B?MEhKbTFieVFyZHgyODZQM1hsdHNjVzBuNlpMQW5SUjRBTmlSa2RmZ0lMVnlK?= =?utf-8?B?YTVrb1RkQjZTL0JQdE11aEhzc2JOSzVCbkJ4aHJDMEtmSGtheElwUCt4WitY?= =?utf-8?B?bUd2NXUvWlNic1dSRS9jV3Vrb3V4My96eTN3bVJETlVkSWFndjE2SFowazJI?= =?utf-8?B?Qnk3UlhTK1crYWJYcGJqVk5ydFpjVzc2VTBlOWdNMEwvL2c9PQ==?= 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)(376014)(36860700013)(82310400026)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 06:31:59.5312 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 39c89255-f442-4a66-e373-08dd021a8bf5 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: DS1PEPF00017093.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5908 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=be5b4c9d2969486ffc3a8606c0b8b2cd77a0169e Thanks. Xueming Li --- >From be5b4c9d2969486ffc3a8606c0b8b2cd77a0169e Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 8 Oct 2024 09:47:16 -0700 Subject: [PATCH] raw/ifpga/base: fix use after free MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Xueming Li [ upstream commit 11986223b54d981300e9de2d365c494eb274645c ] The TAILQ_FOREACH() macro would refer to info after it had been freed. Fix by introducing TAILQ_FOREACH_SAFE here. Fixes: 4a19f89104f8 ("raw/ifpga/base: support multiple cards") Signed-off-by: Stephen Hemminger Acked-by: Morten Brørup Acked-by: Konstantin Ananyev Acked-by: Wathsala Vithanage --- drivers/raw/ifpga/base/opae_intel_max10.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/raw/ifpga/base/opae_intel_max10.c b/drivers/raw/ifpga/base/opae_intel_max10.c index dd97a5f9fd..d5a9ceb6e3 100644 --- a/drivers/raw/ifpga/base/opae_intel_max10.c +++ b/drivers/raw/ifpga/base/opae_intel_max10.c @@ -6,6 +6,13 @@ #include #include "opae_osdep.h" +#ifndef TAILQ_FOREACH_SAFE +#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = TAILQ_FIRST((head)); \ + (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ + (var) = (tvar)) +#endif + int max10_sys_read(struct intel_max10_device *dev, unsigned int offset, unsigned int *val) { @@ -746,9 +753,9 @@ static int fdt_get_named_reg(const void *fdt, int node, const char *name, static void max10_sensor_uinit(struct intel_max10_device *dev) { - struct opae_sensor_info *info; + struct opae_sensor_info *info, *next; - TAILQ_FOREACH(info, &dev->opae_sensor_list, node) { + TAILQ_FOREACH_SAFE(info, &dev->opae_sensor_list, node, next) { TAILQ_REMOVE(&dev->opae_sensor_list, info, node); opae_free(info); } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-11 14:23:06.515775011 +0800 +++ 0025-raw-ifpga-base-fix-use-after-free.patch 2024-11-11 14:23:05.052192841 +0800 @@ -1 +1 @@ -From 11986223b54d981300e9de2d365c494eb274645c Mon Sep 17 00:00:00 2001 +From be5b4c9d2969486ffc3a8606c0b8b2cd77a0169e Mon Sep 17 00:00:00 2001 @@ -7,0 +8,3 @@ +Cc: Xueming Li + +[ upstream commit 11986223b54d981300e9de2d365c494eb274645c ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org