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 D82A145C0D; Wed, 30 Oct 2024 04:15:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C30D742FB9; Wed, 30 Oct 2024 04:15:41 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2059.outbound.protection.outlook.com [40.107.244.59]) by mails.dpdk.org (Postfix) with ESMTP id B310A42EC5 for ; Wed, 30 Oct 2024 04:15:40 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QUR4gxw8HqDFqXT9N4gs2gFxqFk+SOzqUJAUSg1MrqRVaBAYFoFJDCJFDjoUGkBhsUMs0yMeDdueaEt8FykA6gCbFQR+hgM/1W5uxKSmcs//NcPkRe3XQZ3j2rbE6d1v5OiLfl2keGV1YWJXTQfQiZSRF68VcILS8oDrEhzoOioi6GUet7YU6UHboiI/ii5uTm0dVBGy1+2K/+WBIO3crxgZwBzSodAWFVURpGKtqQ7bY+kE/k0E45i4FpM8INODsl3hwRlPLRL/dyttO+SpfxlBYGal8C13luWDSvR9WUUA7aGQIKYH7KxjLUP1Go9KNgzRHrboL/t0HPNKSprAsg== 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=TFYW3KhllMkCsSs223rGbYiyio7BVBr2PxXu/8UKWYg=; b=YNSZ/9aQP6Jz/vnfRkq0GXJZdm77kRYlaeOQrI1HnsZ/9niEnjZR+QQg+EMwrgmYcCGIS1rQipzl7+tAyUPv9KUNVOIERL8RTdp319E8Q/U/wfeBJZjDQ+9TRGKqxrViOdHaII3dmW2irPS8lHSl3LyYG36fnUVpQlL6NC6A6eld4dEpSEmxHSzxycVEXHohatF8c/TD/dLRoTE1oDdZF+TVd95cUdb5vVaJK4HXrPKfPIRtz5md5yPWmXKS62Fa+IvB/5WZ+dsVUA/jilHq/8ywL3Q5JfaeZIsq6P8oKG75RUE0tliaqARLHsxCnn03nvZ/vraeiDbCkQSMGOZ5+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TFYW3KhllMkCsSs223rGbYiyio7BVBr2PxXu/8UKWYg=; b=bsmtbs54AOEQNmyiIsgvfn2Z8T+ergV4SIq07oUZH1oBkjBTmUQkFzyI7kyTXoNVNypPe3WtXSJg8AgM77KHnjG6BfDyKlsno+r5EwZNNuWv3LnTp+hWEMd68LIDLvQb8pappu1PuK/+b9dzvsLTSzafHRYV5DZvN/iSZGLZKsw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) by DS0PR12MB8367.namprd12.prod.outlook.com (2603:10b6:8:fd::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.32; Wed, 30 Oct 2024 03:15:34 +0000 Received: from SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055]) by SJ2PR12MB8830.namprd12.prod.outlook.com ([fe80::c3eb:df02:eaa9:2055%4]) with mapi id 15.20.8093.024; Wed, 30 Oct 2024 03:15:34 +0000 Message-ID: Date: Wed, 30 Oct 2024 03:15:28 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net/vmxnet3: Fix vmxnet3 NULL pointer deref after configuration failure To: Roger B Melton , Jochen Behrens Cc: dev@dpdk.org References: <20241026143336.2099168-1-rmelton@cisco.com> Content-Language: en-US From: Ferruh Yigit In-Reply-To: <20241026143336.2099168-1-rmelton@cisco.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0107.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:191::22) To SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR12MB8830:EE_|DS0PR12MB8367:EE_ X-MS-Office365-Filtering-Correlation-Id: a7281246-3f91-4ba1-d85c-08dcf8911e19 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?B?ODJZYnJ5QVQ4ZzBzUDBaaGZ4SkxWaEt5UW1yazJrOWlLV2ZpN0s5NE9UV1RJ?= =?utf-8?B?MitCTVZNUnhBVlQyak9YTndXQXRXemtoNHFMSlFOVHdWSkRMY0xLV09wWi90?= =?utf-8?B?aUhwUEs1WkVtS1kyeXhUMEltZWlMV0dwTzlaK00zcXNRa0tTblY5ak9ENzhh?= =?utf-8?B?cGZKeWJPamUzbGFMZ0c0UysvZjhJc2JJUXROdmorWU10eVlYQmQyRThteG9s?= =?utf-8?B?bWdtOXd2Y2hkUXFacHVoM0xvekt0RzZIQTRnRC8zcGxYMGp2T2NQNGFYZjhL?= =?utf-8?B?d1lsRVNWNzBCN1FBUitQa1ZIUGE3cHE5MW8wR1J6KytpOExQY3dmcGNScHB4?= =?utf-8?B?Ym1HblJpQWdJZXdPT3R6QjZqMmJsRUxTcTBubmpSNzN1TzZiUWZja1gzdmxa?= =?utf-8?B?ZXFoTFNoL2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utf-8?B?WHRtT2pBU24zVU5iRm5vM2hyUXE0cnBGSVlodVd4aGJaOE51bHlVZ3NscnZI?= =?utf-8?B?N2s4OGFEZUlDd0NsSzR3c1ppdmk5QXlQUHNwVENwQlJ5OUxMdjFVczdPR1Ja?= =?utf-8?B?NU5qeSt6a1FCTmozV1VjcFhqVVN3Tnlad1RGRVlYaTFzYlNyZTh2UWNubit0?= =?utf-8?B?a0l2ZkdzSk41S1RwcEduWWYxdVRQQ2JqTEFNSUlJWkQ2QmZWY0xncWp2UmNE?= =?utf-8?B?R1ZsNzBPcHY1Sy9vN0lwMEhibld1ZFhZN21FdG4vN0VaOE9wbnJlei9qWnNz?= =?utf-8?B?T2FNdXc3aEcxRXR5NFI2MlNZS0RCUjlZZ1NTVitxMWtBY1hRKytRS0lYeTR4?= =?utf-8?B?blJUSU1HWTYyUlpxeTEwMWR2akFvTnVJNk03OHBKamhIbnArbkJRUG4rRG5J?= =?utf-8?Q?gQxj0vCzvj9xkCYevR12nXvbN/8FkRYKalUYtI7?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR12MB8830.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OEsrbzhHUzJGNkg0ekVIOUlTNE83a3hhRFRMVHdUZkRPTkVoNHM0bjd5eWYy?= =?utf-8?B?b3Z3ZE43b2o5TUFyTjVEMHpoRGJMZWZGdnpzSUNQNFlBV3JDQnhRMVhTQis1?= =?utf-8?B?R0hwNjNManhMZTh5SGpvQWgzY2h5cmRXMGFYVVFvMHBuY0J1R1kzQlRkcmJJ?= =?utf-8?B?UDFrc1JEYUswcE9oUkp5YjVIOHhIS28zeUYvUWdaQndYYkU0d0o4VE9ReW1E?= =?utf-8?B?NXZ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TZMMWYvMFgxZHVqU1hXcno5QnhvSnBC?= =?utf-8?B?MEVyVVc4dkZUQjVpbnpLRFdEbzBBa3lqcXFISFNlSDAyV1NjT0hEM2VibjBZ?= =?utf-8?Q?qvertc3uZhkHf366rTm8Ew0lD?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a7281246-3f91-4ba1-d85c-08dcf8911e19 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8830.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2024 03:15:34.0853 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XFXVad9Z9iSMD6mlBdSusrlKOopf1n6YbquT389u+3vb/UvqMFa15lrVPgeYd9pP X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8367 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 10/26/2024 3:33 PM, Roger B Melton wrote: > 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. > > Signed-off-by: Roger B Melton > --- > 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 467fb61137..8d7f95a753 100644 > --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c > +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c > @@ -403,6 +403,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; > Hi Roger, Can you please provide fixes tag?