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 9E42945C1B; Thu, 31 Oct 2024 06:38:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 302A643542; Thu, 31 Oct 2024 06:38:46 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2051.outbound.protection.outlook.com [40.107.101.51]) by mails.dpdk.org (Postfix) with ESMTP id 0A49E43541 for ; Thu, 31 Oct 2024 06:38:43 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WDR86/SFpHMtUhl79SEEp6UtvQ//sQyM4C/khmmhkit0qOkD/c/40Gpb9HM8AfZRNhw63lDbfZacvZ98i51+uMSCKLhyDtbgyIReuy08Vose1JcnXwg9krgSPprKfIrLUHI256JEalRZhdfmb+KqZGZHwrgUNxaxU2RzPVugfH0MAAIzaTtytmwgxc+/ZFRSjz9yn8ktB+Ft5LnpKjsPpxOD3Sb6t+S20qD7aDHg98msEjd9IbQGb020gp+8tOgv8TWPmxfPONk1claERYlSdAH8tP4lG4DCSP31wVTpt1h47QJb9urFjdPjjb3D++x3ZY6PZVg90QXeRkBcD40Uwg== 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=KsSqN4DS3+aEBHZNXXI77tMBu6B1oxwS3fXReOamhkc=; b=F9r2coVtDE4kBXOhrNnQ5TMIjIcuSVcbUdqJfz6Wvvdzf1+jVyOkt2/lcEM9uMvXVhhDV4Lz6VELOCN8rgzNOSuBhzdoFkuqK7JRgcYSyAo7zKhDXizXvAseFxfTxoo6+tmlvt2nJriTFPASduu9LkRq4aCJeD99OaT0SdYVvvMY+psCNV2dqdkrC9Mvto2cYCedYMkLYnr5C3JOR6LzCAkLqfVrNAI3r/g/qkalfb98wX8gwfEB7l8udTNHgRc3PSk4OZ7wHNfEOSnbQRKzIqq+J/WiORy1PS6lN5zpOTy/AcN6pkmJJDDwAxosDvFiZM/2nddYTjagxbQ0UDtRRg== 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=KsSqN4DS3+aEBHZNXXI77tMBu6B1oxwS3fXReOamhkc=; b=HRPS1V4PmZ19UB1wrDH52Ylm7iwp4IPwDpABhDTU0qT0SrRUou4iNhsVrLV88VraxTJqGvKmLWTi6ocQqS5xg9wxQyAfzj1Brhdh/VkpkYyAeWT9KzqHIP1jvjYj2Vxk+coYler24GMSpYQBvBzF+QWQ3MPzhg2rw9b9b5xIpD8= 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 PH7PR12MB5853.namprd12.prod.outlook.com (2603:10b6:510:1d4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Thu, 31 Oct 2024 05:38:41 +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; Thu, 31 Oct 2024 05:38:40 +0000 Message-ID: Date: Thu, 31 Oct 2024 05:38:34 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net/vmxnet3: Fix vmxnet3 NULL pointer deref after configuration failure To: =?UTF-8?Q?Morten_Br=C3=B8rup?= , Roger B Melton , Jochen Behrens Cc: dev@dpdk.org, Ronak Doshi References: <20241026143336.2099168-1-rmelton@cisco.com> <98CBD80474FA8B44BF855DF32C47DC35E9F82B@smartserver.smartshare.dk> Content-Language: en-US From: Ferruh Yigit In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F82B@smartserver.smartshare.dk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO3P265CA0031.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:387::20) To SJ2PR12MB8830.namprd12.prod.outlook.com (2603:10b6:a03:4d0::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR12MB8830:EE_|PH7PR12MB5853:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ca382d4-3a76-429e-773b-08dcf96e46a7 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?ZDlwdkZVeUxhcVQ0cGVUdlZIdmp5U0hTMjlLbGFQdGtyaFlTTmZ3L25Sa0ZY?= =?utf-8?B?NHluN3QzbzBKWWhhUHlzWnJPblNIcjZhMEgzRXlQMmx5Z3kycTIrUnA4WU03?= =?utf-8?B?T2lpYVA5b2NoMjdRMlNTdDdnUDlObXBRRVh4VGxBL1FNREY4Njh0dTdQYTc4?= =?utf-8?B?Wmw1UzhkbVZkOXU2UFBTbnR5Vk5QRGExbndFTDhRM2ZFazZMdXJzVHExd1Z5?= =?utf-8?B?ekxhdDlPZkRpdkFiODRNWDgycTlYeWM4OGYzM3RkeTdhcXVYWllFTzBtY0lt?= =?utf-8?B?aFZIMXo4Z3BVN0RieUNuZkdBUTVrclhEOFZQY21obHE5Y1B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NNjg0WGZpTlg1Z2FVOXJjYktqRlducmdkKzE5ejczT3hw?= =?utf-8?B?VHhTekx1czhXUXdPTFVNdElxN25qYUxGdDRoU2xtOW1RMkFTUmZQUnJkd1E1?= =?utf-8?B?cGRSNDRtZ1EvVmdnQ3p1djRKVUFwMEozMys2WHJUQnlXV083U2ROaW0zMldK?= =?utf-8?B?dnplOFlzNk5ueG4vYUFVYzNibjcyaTdLazc3Q3p0UHMyMlJESDdsN3N1R0x1?= =?utf-8?B?VVBBUUpveDhOY2pQNU5hSHFUaGRRVjkva0czOTE4SmtKK3lkVkh5YWYxYjls?= =?utf-8?B?NVVoYUtQMk9VVEw2NDIrVjNTYXNvdzJsV2xkd29qODJqTmdLcUNZYTdxeFNX?= =?utf-8?B?cjkwME5EcFpYSUtRblJiNzNORWRmbk53QjE3ZUZTYy9DTm5Rd3FLT1V6Q1ZU?= =?utf-8?B?NzFWK2tXN1dvVkwrelhxNDdjRG5lVXF0TTBtNXFSMTdHbXdGdExHRnJEdDFm?= =?utf-8?B?dlhBemplbWY1dFQydi9XblYxbTROWWozMU96TTRzYmxTZDVmYnYwSlA5cnl3?= =?utf-8?Q?KKbXnvSOuYqY1KONSdDGArVlX5AMibsSxuYWf4V?= 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?ZTJYdytFdTRaaHJCd2tsQmwwWUhNQnBnTFh6VTZYRHZiUkpWMTY0Z3ZVU0xF?= =?utf-8?B?YW9JZ3FQMFBWVnJXZ1NrbFExcFZSV1hhOW9VQnllUnl4VVBaS2ZESEtWSnA0?= =?utf-8?B?LzNlR1RZM0lHVWszcG4rMWtDeEdhSEtDVnpN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SzlKdGJjL2dXR0J6WjFYcDZzSVNybHBIZjZ0ZzgwcjhkT01QM3p6VFNz?= =?utf-8?B?RlFudUxaM09TcnR2aUthRnJUQmtoemIzMFhUb3B5bVZid09CNlNFTHVkNWFF?= =?utf-8?B?MUsrRWZTMEZCLzRwM05UcXNLQmptTkdQWHFmdlUrai93LytPZU9TcEhVY0lN?= =?utf-8?Q?X0mc8YywJylA1SgW9Iq8r1nlA?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ca382d4-3a76-429e-773b-08dcf96e46a7 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8830.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Oct 2024 05:38:40.9193 (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: zMzC4TsBSH/GiPoo3vZ1QAskHTCB5KZQEkmco+WQz2G43evUhL6wn72/ZILlKXVM X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5853 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/27/2024 8:43 AM, Morten Brørup wrote: >> From: Roger B Melton [mailto:rmelton@cisco.com] >> Sent: Saturday, 26 October 2024 16.34 >> >> 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 > > Acked-by: Morten Brørup > Fixes: dfaff37fc46d ("vmxnet3: import new vmxnet3 poll mode driver implementation") Cc: stable@dpdk.org Applied to dpdk-next-net/main, thanks.