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 7895245E41 for ; Sat, 7 Dec 2024 09:04:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 706DB40281; Sat, 7 Dec 2024 09:04:00 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2066.outbound.protection.outlook.com [40.107.92.66]) by mails.dpdk.org (Postfix) with ESMTP id 0BF5240281 for ; Sat, 7 Dec 2024 09:03:59 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TEkZAglfo18d8qhO4Blj1kPj/SqnEOYLq3tHe2hgkPtLe28jZpg3SV1c+oWxwLmRpqDDyu2yDmIz+nmcvmbAtv0YF00qu00uP7uqEDwbYPAwZ4xmNMbcJalxFwKv40a+TQQ3JYMta0znQJgvROjQJJIQOWOvnR6KOWSsjI/okamOuUkI/lXk0tElf/jxDiR7e/eskUF0hkZYj9/4wQdBzVPULiBKvlJVR87mZ3yCt83FwjE7kbApG7hJ66e83tg+nqiM493p7+JC+4nCEqPosHdHwmltD5oWYiPNC46ZVGFyoG6Z5Wsd5GDg7R0LIeQRN7sKlCCtU/jUU0tbhVb9og== 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=bHTY/Pr3h5wowIvajBlQkygVddvje4id3+X4b4YIFFk=; b=IJ6FqEamr0AximQihZ92KQEaDiORkH1N7yv8P7I7YQ8Wu3f3ku8vlnwgjNZ0gyDeNS1mtw2lqyPCSPDufIlsSRAHbpzeQG2gxUSIUARM6DcbzZkHakIBbFEmDOUqRbfFpwlAcGx6dyhkOEPXrUi2QlyJru8l4BhOtb1GcAdbMLZZLEILWJIF3l9ub8TR77vZXHUj51x4y2KEg5YmQprUmXdGARGAKGWXF+MWaBsvssOt+mPJddG4HHEGtbyukIIsKdHijyxCp9qpcmAMe9sJDahJBxu8m6vYIpFnf+KS0JTCDV8N+DMvu45TWO8eSlTUUULiGCgwr1PMufvf4H3gnw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=cisco.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=bHTY/Pr3h5wowIvajBlQkygVddvje4id3+X4b4YIFFk=; b=BVeJJ9ak45P2gnp3eWVPahkLHT7VEHuyq6DR5HH0u7/8tkP61L9YXueBSUbtrZ7iQ1H74UZOHcGPWIfA4UZ4163NGOFjNMqqvZGtLjRW4xkeV0cdE8Bqj3FlJaTYVSYe0KKrDrfKiZXh7aSKqLtnom5kmAmkBrro0sOHvseXIV8E2x+GybVfsoRTQ8HSAASrr5yPdsSlalPR9NmcYufJw+qyjg0leBFyFDJcmUs1MF0tkJEcHt5jYXpCBZX9dOOdd7epxfLMBTEGJ2VS7eyKQ55YSAEVA59SekmarJnzdIRHfuDiZmVdDeU42PxTVBYyhDQdfDuJybo8wP6ZiZCfBQ== Received: from MW4PR04CA0242.namprd04.prod.outlook.com (2603:10b6:303:88::7) by BL4PR12MB9508.namprd12.prod.outlook.com (2603:10b6:208:58e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.19; Sat, 7 Dec 2024 08:03:53 +0000 Received: from SJ1PEPF00001CDE.namprd05.prod.outlook.com (2603:10b6:303:88:cafe::f6) by MW4PR04CA0242.outlook.office365.com (2603:10b6:303:88::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.13 via Frontend Transport; Sat, 7 Dec 2024 08:03: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 SJ1PEPF00001CDE.mail.protection.outlook.com (10.167.242.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.7 via Frontend Transport; Sat, 7 Dec 2024 08:03: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; Sat, 7 Dec 2024 00:03: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; Sat, 7 Dec 2024 00:03:40 -0800 From: Xueming Li To: Roger Melton CC: Xueming Li , =?UTF-8?q?Morten=20Br=C3=B8rup?= , dpdk stable Subject: patch 'net/vmxnet3: fix crash after configuration failure' has been queued to stable release 23.11.3 Date: Sat, 7 Dec 2024 15:59:47 +0800 Message-ID: <20241207080055.488538-30-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207080055.488538-1-xuemingl@nvidia.com> References: <20241111062847.216344-122-xuemingl@nvidia.com> <20241207080055.488538-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CDE:EE_|BL4PR12MB9508:EE_ X-MS-Office365-Filtering-Correlation-Id: 842a9b49-e84d-4b86-8d28-08dd1695b142 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|82310400026|36860700013|376014|7053199007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?UHQzZWJQN3BWeFdQTHhNMWUzdXllbkczMDlBV0VRSDQ3RHVPaXJGdkd4eVcr?= =?utf-8?B?Y0kvemo3R1JNUXBOdXZlSm9xOWxaZlJRVi9IRER3Y2JYd3RwWTdvOTRtbEtC?= =?utf-8?B?OGQ1ZnF0QVhtRXdaM0d6djVJWFNLZmlGM2JPVVJITTRoZ2c1eUZVSHpIRDZq?= =?utf-8?B?aU1NSkl1RmhJeFB4OTlQZitUWGdMMExVL00xYXJ1R0NDQUpxaGxKblNlMHQz?= =?utf-8?B?aSszN2N2RXA4bjhaKzMvREh2cDR3QjdMaXFzWk56aDRwWklCSEorWVZ5Nk5C?= =?utf-8?B?Yk5CcWVKMEJoU0F0QlEyUllnU0tBeWhxWW5wUFlITHk3V1VzNGE5YS9sYVBM?= =?utf-8?B?K1NsUXo0U1dWRmFiSTc3aitKOWtyeEliMkY3ci9hcm9Pb2U4UzlmRGRtYzB6?= =?utf-8?B?eWY1LzhQZGFHNHRVd3lOaExRUUsvZTloYXp4Mkl0dmtFZkJ1YzU4dTNjZXAz?= =?utf-8?B?Y3JFeStZRWUyQ2hvTFdaTkMyUmo2WUtSMmVNOCtOaFZ3VTNsUHpVdnVvQ3Vr?= =?utf-8?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RUJsR1dD?= =?utf-8?B?Z1JlejE1NUV5MUNsc0NaU1g2WHhjMnB3TWVpdklhbGNaTytwcW9HZzNtOVJK?= =?utf-8?B?S09IZjd1eHBnUzJIU2RHT0xhSUNwT2hUZWQzdU9YeFRVRGlkTWp4QjQ1Tnpu?= =?utf-8?B?OXFyREc2UDBGTHpnb3d4Zk84R1hkalJBWTBVaWd2aU1kcEkxQldtUUdCMXJl?= =?utf-8?B?K2lPajJoMHVvUXRCTFh0R3lHQjlvalM5a1M2dVg0eVNGaE1ZcW1RRjVVaHUw?= =?utf-8?B?TXlBMHNhTWZTSjN0dXdWbU42VkpNbk5OcWptQW1KK1VLQlhrVk9qdUltU1RM?= =?utf-8?B?Z2JWYXhYbVRldi83OUxBV1oxWDVjOTJEQXNVWk0zNFNKR0pBdnlXWVhKUDB1?= =?utf-8?B?MjZjbTBydk1oSzZjdHllWjJham43Wi94bi9jMzhQNWVpLzZlYlBkMVUwVVRh?= =?utf-8?B?VHZxOHBUc1RiYkg3ejVvbkFSbjUyek93bGNWdDBVZ3NVYVBUMmNBbEhkenZo?= =?utf-8?Q?UuwA3t8D+5Whv3BFi1zRbQSabx/yNoME?= 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)(82310400026)(36860700013)(376014)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2024 08:03:53.5720 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 842a9b49-e84d-4b86-8d28-08dd1695b142 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: SJ1PEPF00001CDE.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL4PR12MB9508 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 12/10/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=349d424fd49ca375631073d9da4d08e892a70e49 Thanks. Xueming Li --- >From 349d424fd49ca375631073d9da4d08e892a70e49 Mon Sep 17 00:00:00 2001 From: Roger Melton Date: Sat, 26 Oct 2024 10:33:36 -0400 Subject: [PATCH] net/vmxnet3: fix crash after configuration failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Xueming Li [ upstream commit 439847c154ccf05e1a8bbb955c552921514d31e2 ] Problem: If vxmnet3_dev_configure() fails, applications may call vmxnet3_dev_close(). If the failure occurs before the vmxnet3 hw->shared structure is allocated the close will lead to a segv. Root Cause: This crash is due to incorrect adapter_stopped state in the vmxnet3 dev_private structure. When dev_private is allocated, adapter_stopped will be 0 (FALSE). eth_vmxnet3_dev_init() does not set it to TRUE, so it will remain FALSE until a successful vmxnet3_dev_start() followed by a vmxnet3_dev_stop(). When vmxnet3_dev_close() is called, it will invoke vmxnet3_dev_stop(). vmxnet3_dev_stop() will check the adapter_stopped state in the vmxnet3 shared data, find it is FALSE and will proceed to stop the device, calling vmxnet3_disable_all_intrs(). vmxnet3_disable_all_intrs() attempts to access the vmxnet3 shared data resulting in the segv. Solution: Set adapter_stopped to TRUE in eth_vmxnet3_dev_init(), to prevent stop processing. Fixes: dfaff37fc46d ("vmxnet3: import new vmxnet3 poll mode driver implementation") Signed-off-by: Roger Melton Acked-by: Morten Brørup --- drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index f98cdb6d58..082ae17465 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -402,6 +402,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev) /* Vendor and Device ID need to be set before init of shared code */ hw->device_id = pci_dev->id.device_id; hw->vendor_id = pci_dev->id.vendor_id; + hw->adapter_stopped = TRUE; hw->hw_addr0 = (void *)pci_dev->mem_resource[0].addr; hw->hw_addr1 = (void *)pci_dev->mem_resource[1].addr; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-12-06 23:26:45.084068315 +0800 +++ 0029-net-vmxnet3-fix-crash-after-configuration-failure.patch 2024-12-06 23:26:43.913044828 +0800 @@ -1 +1 @@ -From 439847c154ccf05e1a8bbb955c552921514d31e2 Mon Sep 17 00:00:00 2001 +From 349d424fd49ca375631073d9da4d08e892a70e49 Mon Sep 17 00:00:00 2001 @@ -7,0 +8,3 @@ +Cc: Xueming Li + +[ upstream commit 439847c154ccf05e1a8bbb955c552921514d31e2 ] @@ -35 +37,0 @@ -Cc: stable@dpdk.org @@ -44 +46 @@ -index 78fac63ab6..79ab167421 100644 +index f98cdb6d58..082ae17465 100644 @@ -47 +49 @@ -@@ -403,6 +403,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev) +@@ -402,6 +402,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)