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 555B7460FB; Thu, 23 Jan 2025 12:17:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8EA154067E; Thu, 23 Jan 2025 12:17:51 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by mails.dpdk.org (Postfix) with ESMTP id F18D240269; Thu, 23 Jan 2025 12:17:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737631069; x=1769167069; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=rjWl3hGyE12/MtDK5HwshLfu/68VE2dMePcMY5pNjew=; b=CPvVFl6Ud0PCLOvR10e4muPE/EIH77LqElSARJ7TlXT1l22NrVa5SUaf g4SB5HX/0h4MSV5S60awI048zM/jaqMrL0wKu9ZyhMHjU/5cIE+75pzbB IEDFd2BPm+jEa1RSwP5w832JwPIdA8DS0qBurmGMFRr7f5yRVIyNDpr4s sTuml91d8rt5KfBLJXgzR20iObeoV+y+8yD++zg268AJfB5M2JbQwO+Lz rK5/41CFJ9sBadqLV8ArwLLdPLXHcp9rkZbtyux65CHe8C+QVTKSoLQqp h7kmmv+6RRZUtZIO25iGqkEEsAL86lxXonK5wtlAbjlAWPbtN6qCtJH3O g==; X-CSE-ConnectionGUID: bIMBNmipQ2+E18epguTtFg== X-CSE-MsgGUID: +uIe6AY8Qhy5tXYl48bArQ== X-IronPort-AV: E=McAfee;i="6700,10204,11323"; a="41790518" X-IronPort-AV: E=Sophos;i="6.13,228,1732608000"; d="scan'208";a="41790518" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2025 03:17:48 -0800 X-CSE-ConnectionGUID: JhRgDn9HR42A9p5xgwPT5A== X-CSE-MsgGUID: q07DRPJtQKiZ1n8sFc8pKw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,228,1732608000"; d="scan'208";a="107246830" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orviesa009.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 23 Jan 2025 03:17:48 -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 03:17:47 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) 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 03:17:47 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.173) by edgegateway.intel.com (134.134.137.102) 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 03:17:47 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FKFK8jqsU95gnkTD7F3S14ukXUW8dNfA5NFhEMj/UkCGa1KSspb+32PF25f1VlSSywV2kH1x5vdbqNmjFtZ1tgY5/lPJGbuHjfOc8XUxJy/8EqqXO6DJr34xDlCf9G9/Hj4FuxLFMve5HX9atzbMgGJiRHcR0lz9G419dmmVu/tViPYQWFRYklfhrGu9CiKppnBKJ8ewrpn5rp4X2MImeAlZrYOCjiF+QbewBe9a5TNZvdtX1CvGuLl9RjuKJ0jn0b7wCKQIBbh07BNijlVKcrfpxBir92RuxpH2ZvXWnAagR6ZtO5D4NAuBJ1Od5J3//pkGsIWfXOUnGsinOH1NXA== 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=xvBVfvTFnthune2x9/p14to/38u3qz1kuBgquiGsujk=; b=TRRIVC6R5qeGibXEn5A73fwhaibFJQH7MxBcMjQN9QpnQI2l28S8dvbnrrSMRFnjEgwTm1th4muCg+fMwzntgMuupTV5e2QWpZdxbHY7bnIgmiVweiedBufu7bx1MDHnq/gtp7AnKD0ojMrPeP3HYLMwBAGxz52EUYKEZCZXe1vCcU/a6Nv6kKun2Q6fomnYxkS634hew91IoDDH0B1WKzwGNX++J/tKfq6Jrk0VfUB651boK1SzONOw1fOpwzfDfRXzcwxVFSLyX3ix6ILC8TX36Bm4MZHo+Nj+VCs9Gvsg9JMqz5nc32q12Z1/QELeeJNXyc0SCAuIOZLd+uSWeA== 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 SJ1PR11MB6274.namprd11.prod.outlook.com (2603:10b6:a03:457::20) 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 11:17:45 +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 11:17:45 +0000 Date: Thu, 23 Jan 2025 11:17:40 +0000 From: Bruce Richardson To: Stephen Hemminger CC: 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="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: DUZP191CA0014.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4f9::18) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SJ1PR11MB6274:EE_ X-MS-Office365-Filtering-Correlation-Id: b0afb615-6c31-4e71-debd-08dd3b9f8f9f 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: =?us-ascii?Q?1im7FYirMib1AHzuhDBrGTXU3Y5ZXrtu2JQhJSCq8US/onzGE8alQkLBic8r?= =?us-ascii?Q?KIUbzXgFBVoiELIR+qAUdCzL/76wCT0Nniv/2+8dkhBU8jKcF+oHyAKyFTrN?= =?us-ascii?Q?tjMa/LdbgSuJvvqeWUbZKtd8plkLrB137g6Iwbsx5SX2Mhdh31dZm781bI6t?= =?us-ascii?Q?5nv05/sMYlNH2dsY+WN+ulwmQ3W7Y37gKo6MHi4FJXLGHWvX00268p0OlubB?= =?us-ascii?Q?LrEOeKFkT0P8v5fHlQAIT2cz5l1zNXLDboitJyPfjhp1sFFA6ATm6XzLHnBz?= =?us-ascii?Q?ilJzyTktRgcWsaro/oqCZ3qH2zvXmyZT8XSshyS/S6Mil3Big85uN3SeFuPm?= =?us-ascii?Q?fppW7WpfW2Tfmm5Yv5D62I1hXHJ/Z8ZnUOkJzcVtsU1nqB47UTIVO2M1dNsE?= =?us-ascii?Q?gm3NP4/7V1s1qUlQq6+tdQDl5HSrwckhblyR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-ascii?Q?GC/kUWcmdGiwe2rgzx6JWf7O5mxmQEc2F7TsFebPSHrxyH6u1jPcCnYljjzY?= =?us-ascii?Q?lhpqvDPHVKLy6KTcD+JQOByRlRMw?= 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: =?us-ascii?Q?PHmEX5L7776TL3qcPDqTKQOw8nhWvnmWG/mRUTrMrrUeA9cPM/+RFmyYaWdP?= =?us-ascii?Q?GizLpBk+x+PmD9EwXlNBFk7Hzjj+C4/rruhAc7NgT3SYhLnmHHL4ZqiEB5Ue?= =?us-ascii?Q?+CCcJpX3fTI8iNAfWt6IR6LM/fLuQX/kxSUpcd4LiWNYraUOmGTDqkSGcfz0?= =?us-ascii?Q?9E9nWtbYMgPfEFACmFdXUNwPtWh5WEphXKKrcA3wzAJ+6uvRGqFnWF4zkYbc?= =?us-ascii?Q?My3p4QGpew3hhSQKvlLnrP3m/7E20EatSkXZnTgfZxXWFe3hVEPUzoAbSfIA?= =?us-ascii?Q?Stl6dmmcyVrr+rR+lBPt65JGgCGVGHqYzW3C+T3Na6u21JAW01EA/anqBfYI?= =?us-ascii?Q?BqR/WFS8PruCSHuLun3oDwnZmemAgz8xy/xvM+C97L5QP9nyicl0hJBLGbfz?= =?us-ascii?Q?ayJFvDkpjjo15H4lzRybBSShRVpHSPKbbs54NW6b17s59Ijh3kYVQX9XyPSr?= =?us-ascii?Q?hDs0rNTixOmUCKujWs47Ov7TdgeucD/nDNqzsqxSJGwkMPd/xPcNmnKvMCF1?= =?us-ascii?Q?icRY4X8tzhbJxntMsekb9j5+SvrWv1iwul7X1k7VYEuyntJYLe7lfrjtkGn/?= =?us-ascii?Q?Bea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JfLUp6/iEF?= =?us-ascii?Q?ueVa4djS7hOKCSMSaRYK9E47JHgl0Bj0v4F6QYbCyvIs1pGIx7MS17fHposo?= =?us-ascii?Q?i9eNMz4EbKxaS3MXaVJfIkBwyRgn9zDpolgf1+sVWV17kJvu/F1gtAj/h632?= =?us-ascii?Q?uA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: b0afb615-6c31-4e71-debd-08dd3b9f8f9f X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2025 11:17:45.3121 (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: qnBtJBdB9dxH8v75fcikvRmoltFm4WwSc+UMf9+fnsAJlJMWBErGSm3h0YUBKorhAT8ii4rwFsghLg85Tq7zctDxjZ5aaGeGflOA5yivl9E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR11MB6274 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 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. /Bruce