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 BB775460FB; Thu, 23 Jan 2025 13:54:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 447CD406BB; Thu, 23 Jan 2025 13:54:12 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by mails.dpdk.org (Postfix) with ESMTP id 74DC040263; Thu, 23 Jan 2025 13:54:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737636851; x=1769172851; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=wKagME0srw772yHF6LuvwS8tC89o0Gl9kmLh+NVM7Vk=; b=XtRbzQbwQoG8T7hCqu4B3mnynJklJCtfQXWABvSFBh2jHsQjMUxlTWUK WkxOmv8XfVglOqAnCOXcFp2B8O83qWdCfyldXpvEG+Tq9ps6pCE0fUvg3 fQEXGl4EmIlkifjdLKuXcR0/JPma8q8wHmn3lWQtZ0hvhEABQKdRuAne1 PTGlrFO06jLYpikS/enWsu3ymCYO6VTL0HPCcwWdVlJDwCMLNYzUQIwH/ hZJxP2oIMzQ3ZqJGQfF+41wOLcYDPq8X/YLVfKsIu3QieAiyl+3YAjL6o ZN17GVHyk6Ogazttfd38Eh2RpiiD6bs9Fn0hnFkjA7BSTTUA2yQBHesFi Q==; X-CSE-ConnectionGUID: KrcnF7LjQxi9e7LxhAru3Q== X-CSE-MsgGUID: GGJYh/CqQmCAzH/RItywcw== X-IronPort-AV: E=McAfee;i="6700,10204,11324"; a="41798199" X-IronPort-AV: E=Sophos;i="6.13,228,1732608000"; d="scan'208";a="41798199" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2025 04:54:10 -0800 X-CSE-ConnectionGUID: AVQKo5OXTXq/mSzC1a2UCQ== X-CSE-MsgGUID: tt69hVaQSAOKHumjS6uNeg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,228,1732608000"; d="scan'208";a="107446830" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orviesa006.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 23 Jan 2025 04:54:09 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Thu, 23 Jan 2025 04:54:09 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44 via Frontend Transport; Thu, 23 Jan 2025 04:54:09 -0800 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.46) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.44; Thu, 23 Jan 2025 04:54:08 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dCVVjBzaSgApz5X7Y9FVBAdrjTVeQscEP8HMZ8pPYRxaZEvSxaKshzMJOHKWyzbTHgdh4XWUXFoUsTLlkoh0W73ubQXTlaJ+BOzNs9I/bcAT8oyvOpF3+GpoABZLGfjJba+NFFWTNJLFvOwcqMB0FL5Dy03Q9Z6MOxGBud0Ailu40hXFfD2JX5uuAXi2Tv2EdNfsZDHUNqLrf0aHWyIL+0r7WCboiyXwIOtG7zwxOPfgo6hryzS5lyBABZNHJaudU998/F7TmJ7dddE2fX0lOnoyF/IxBgHm69Vxy3WpNSt+NJ5Gf8m/JOp3vAwBL2xK7eu7Ii3iOpfokXe55Z6bzw== 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=ADCb72kwPCC8DMLm5vKs/xPaL58h/uP35cbpW2zPQtE=; b=S1i0WSvhL2gYcgrAPjMVH3RrqD256BgHnZZSrs5PjapmexfSOemu8eIT3MFz92ioLiDJ8AgxZjsh+yqbOSAnXPsKaHu+RwB/PUPgGFt5NPen00ALPk8sSqrLfj2GcWgL1a0zEpzGYnVyTss8WYNbYONTXBdoE88JiuYva/AQVEp85w7UF+IVx0LIzS1ujnrD/CMNTSDQ3oODuP+RBiwc3n8PgiRCtvOwsVUJL7jueJuCZJnM9FjgT8L+ZLU4Ak+vHUUiXEcFtY1zRyeWtsG/3wB4B6BSKDV7ffJzChOiKxAn/OsCbBLPdkV6d2izAdzlim9YgHC4Hd1X8/isBIh1xA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by DM4PR11MB7400.namprd11.prod.outlook.com (2603:10b6:8:100::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.17; Thu, 23 Jan 2025 12:54:00 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::f120:cc1f:d78d:ae9b%5]) with mapi id 15.20.8377.009; Thu, 23 Jan 2025 12:54:00 +0000 Date: Thu, 23 Jan 2025 12:53:55 +0000 From: Bruce Richardson To: David Marchand CC: Stephen Hemminger , Praveen Shetty , , Subject: Re: [PATCH v1] common/idpf: fix heap use after free error Message-ID: References: <20250113085404.1447006-1-praveen.shetty@intel.com> <20250113083001.611db94d@hermes.local> Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: DUZPR01CA0243.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b5::11) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|DM4PR11MB7400:EE_ X-MS-Office365-Filtering-Correlation-Id: 522d1e93-63d2-47cc-0448-08dd3bad0200 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?B?MUo1ekF1R0kzVWlQTnQ5UW9aK2l6M1hqcXUwR2ZzK3VwWDIwZ1dmdGxXbytt?= =?utf-8?B?SG1hM0w3NU9TK1c1aTFVV3NVNnZHbkpTMVNINGtHcktnYmhmaStmYnlHWmZu?= =?utf-8?B?OEdEVTZHbEtjcDJjNHUzNnRJM3ErbU1DTm5FcHRnakhNUFNTOFh4ZU9sa25F?= =?utf-8?B?NkRMM0dYOEZWWTBVdlAwNlVzaUx5bnNSZkdIbWRSOHlQVm5rK0N4MEJwZGg3?= =?utf-8?B?NlI1MW5IN2ZlVGxrOGVXbWZKZU5mRyt1WFZPR3liVUdYU0EvMDcxRTlFQ0wr?= =?utf-8?B?WmRxcm0xbDNpTEFSYWVqclc3TGRreHUySG54OGQwSEo3cHhtOXpIeEplYnZa?= =?utf-8?B?TlB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utf-8?B?b3FUZjlZVGdrYzFnZS9tL1Ezdk01d2RPcTVJS0tTYXhMb3dDNmVXVDJwL1pX?= =?utf-8?B?RDE0NEtjbkNMbXg5UWNOUnJGNHU3K2pDbGZOclFwaTRzekdWWEhtai9kWWFi?= =?utf-8?B?dk0zTTIwZTNwaEZVQW0vcDZpQ3pTMkYvR0J5QTZlTXJJK0c1cGNkRENkN1JK?= =?utf-8?B?Y3ZBeVBjMnJ6Mll3QTl2OU9JTXdkdWU0dEFwVnpIVFlyOUxuU0JIY3RpN3Jh?= =?utf-8?B?ZHJSMDdMbXhiaVVBbDFXa0tRdFJBY0MvVXpEbWtaVzhDcEw0dTVhS0dKTVVq?= =?utf-8?B?Vkc5dVNvdTNROVhHUE9WU0VyTUxjMDJIaC9IRi9jMUllRmFZNlVqQ2FzWVFr?= =?utf-8?B?VzcrZWZSOFZUb2RBajNiOGJaY0VkdzdOWHF2ZERXN0ZFeEFZNms4dEtHbFgv?= =?utf-8?B?SlJYUjlkWnNtb0ptUGI4ZE1qbjhveWNZdStHbVp0YVA5MmVuWEREaWQ1K1l2?= =?utf-8?B?Z2t6L25pRi9YbUhYWnFJOWkwYVdQTU80RFRJZUowZVVLQkg0ejY4SUpybzVr?= =?utf-8?B?OGFkUFVWNCtTdmtYRi9iblVHa2UrRGNBcmxuQVhUK1NleFVhdkNIeENoekNs?= =?utf-8?Q?raJjqlU234avd?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?S1NmMzZSSldUUURoR0dYQkZzSW9Xd2dpWDB6K3N6azNXRW03RnpPWnNXVDVv?= =?utf-8?B?RkpTbmlib2VFbGRDQzJxdnZyaz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8?B?ZWZjam5hYTAxazRMeUtWaHlZRGh4MEdnVXJ2ZjIvZnM0YTZUMW0vMTYzQ01X?= =?utf-8?B?M0UvblArQUJuVWh4YzZTR3JaNGthTks2ZEhuSVdnMUJMQ3QvSDh5WnVFZG1H?= =?utf-8?B?aTczbytjWCswNno1WldhZEVraCtrTFVxdVBWMk1QbjU3LzV3STB4SU03ZGNK?= =?utf-8?B?L1hJbUFsWWY5aGVIYlp1WHlBOTJlblcwbGFYaG93NldrMHV5ZmRRSW1UZmVo?= =?utf-8?B?OVQvZjVZQmRGY0ZaSzlrSFg5SEIxWUdHVzVaVG5DdGhhVnhNOUlTODBodU1m?= =?utf-8?B?cnc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: 522d1e93-63d2-47cc-0448-08dd3bad0200 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2025 12:54:00.6727 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VGEXJD3bjOg/35BWOsYGpkes8UT8o89WJKs2cqS/5VGQIt2KPI0PKL2id4dwW8ewVNN9hqegbKfC1cDwmB5ceZ8JK4OHfFeP4Qjc2BsQYNw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB7400 X-OriginatorOrg: intel.com 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 Thu, Jan 23, 2025 at 12:43:50PM +0100, David Marchand wrote: > On Thu, Jan 23, 2025 at 12:18 PM Bruce Richardson > wrote: > > > > On Mon, Jan 20, 2025 at 02:32:49PM +0000, Bruce Richardson wrote: > > > On Mon, Jan 13, 2025 at 08:30:01AM -0800, Stephen Hemminger wrote: > > > > On Mon, 13 Jan 2025 08:54:04 +0000 Praveen Shetty > > > > wrote: > > > > > > > > > Heap use after free error is detected in AddressSanitizer while > > > > > quitting the testpmd application.Issue is due to accessing the > > > > > empty control queue in the idpf_ctlq_deinit > > > > > function.idpf_ctlq_deinit function is called during the > > > > > rte_eal_cleanup routine. This patch will fix this issue. > > > > > > > > > > Fixes: fb4ac04e9bfa ("common/idpf: introduce common library") Cc: > > > > > stable@dpdk.org > > > > > > > > > > Signed-off-by: Praveen Shetty > > > > > > > > This should not be needed. LIST_FOR_EACH_ENTRY_SAFE part, don't > > > > understand. > > > > > > I would tend to agree. Is there an actual confirmed bug here? If so, > > > then either our standard list macros are broken, or the code using > > > them is doing something rather strange. > > > > > > > I followed up on with with Praveen, and he went through the code and > > possible solutions with me. The issue flagged by ASAN is correct, > > because it turns out that the version of the _SAFE macro provided in > > this particular driver is not actually safe! :-( > > > > There are therefore two options to fixing this: 1) fix the macro/use a > > different copy of the macro, or 2) rework the code as in this patch and > > drop the macro. Copies of the driver in other OS use the style given in > > this patch, so we will go with the second option. However, we will do a > > v2 to include the removal of the bad macro, alongside fixing this. That > > should hopefully prevent this issue from reoccurring. > > > > Praveen, will review v2 when you send it. > > Sorry, I am not following. > > 1) seems the best way as it does not require touching base driver code. > Afaiu, the LIST_FOR_EACH_ENTRY_SAFE macro is defined in the "abstraction" > header that is DPDK specific (drivers/common/idpf/base/idpf_osdep.h). > > There is already an implementation of LIST_FOR_EACH_ENTRY_SAFE in > driver/net/ice/base/ice_osdep.h. > > (note that it may be worth providing such a macro in a common place in > DPDK and remove copies of it in various drivers). > Yes, that is correct, and double checking the IDPF shared code confirms that is the best solution. /Bruce