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 0D8F145A7A; Tue, 1 Oct 2024 14:17:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C918A4027E; Tue, 1 Oct 2024 14:17:26 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by mails.dpdk.org (Postfix) with ESMTP id B05B44027C for ; Tue, 1 Oct 2024 14:17:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727785045; x=1759321045; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=6sLxJxGp3DWwELbaqWiK6X7PPny1GvTNIslApoNrtJI=; b=JCv44B/a0ONT9M8Q8cdsCkaX+RwIMl55smi8iDcy6QNd/uGgxNrtedbI ogmQTAykvj3fmFVNpMaPZkkAC3myqom/zx59QeryXaCbviZKfbVRNwlXU 6jJ/5NeAhpVartpAxY7qk7+FNYHHNBY/Lw8i0Fi2g+qRTbmwosIhMC7hx Xy8XxddmEWTkV+1rvo98rGF1m/nr+4jlr1WMMVt5QV7nzTD/LaRCwcyk3 eQQANjSsoViaaf9kU3/XbXjf9XgzTAtMOykNENGZP/6LBEXUqiPq/LozT da+mdv+cKJhzgZpzCLat04J7SEA8PPQsnzPON2X8A0y9Ctfdn16bI7FC2 A==; X-CSE-ConnectionGUID: oC62dr+pQXapfZSZwDcNxA== X-CSE-MsgGUID: S+EcCH9fTTuUteDmwY0rZg== X-IronPort-AV: E=McAfee;i="6700,10204,11212"; a="30623036" X-IronPort-AV: E=Sophos;i="6.11,167,1725346800"; d="scan'208";a="30623036" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Oct 2024 05:17:24 -0700 X-CSE-ConnectionGUID: xkdcXajjSQyOJiqps+V6yQ== X-CSE-MsgGUID: heMcdEnsR1OY2nBSr3pH3Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,167,1725346800"; d="scan'208";a="74444054" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orviesa008.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 01 Oct 2024 05:17:24 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 1 Oct 2024 05:17:23 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Tue, 1 Oct 2024 05:17:23 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.173) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 1 Oct 2024 05:17:23 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Z7/HBdVZQaBZBh11SLhvNPeFxqCRL0mVTo7GSmlXLS8WnNnKv0BBpsdQNS3YQHAG+F0aQxtseOvIfTyi74fUtejY12JVRm+i5Df4Cz6jUGTv6wxcBBRG540js0uob2TUogkcYCwg1NLyJoLxjUKONowBiQyleKjSA6bOF+UC9mgj1td2VHmAbHXORxOtGMVgtg7pbKQYUJGTCgDuECEfuZxxU8lsYvze/EtSHsmob4IoCUwmRBrWawc3rIqZWw9PK3gnvNjWhg0BKXsH3tsV0xX57ygAi07YAVNEXKXBPZRb/AAiMGwQtIDmOlhtdXpV5rWd+ObhmKz9gxr5rEPdXA== 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=VtDTTJXAFSnEC6fsG8DrKiBZfk88/rkMQxNTOx3uqyA=; b=yL8JO34aAmQMyHTmbWuhV7Hi/3RALkCYWwgftIJVW5GvRNuiwYHOTu6+VWUMSvi6LhjoHx6V69tQZZqGAsvdIJ370jfW/YGiUrdjuvCqcqNlUZB1eg1Ax7BI1VAemxdIXHsefPQ/G7vCyFgzzlhrMSn5fcxgSmwSx0cmL63+UmwZe7/2k8TdAMAvSg+bYREHk1jNfB5EyFBCrlI9srWmZQZM9JoswUBQnmX+nx2uuo+cnNr+3QXR8nl3twdOuZVyFPpSl8osENqQqfE8n1C8yU9BV7SwpMJxVOq7TrPnixTeimw1lzNgXKRnvbWd1gb3fpJmrJ2w6yofcuFvU4mW0w== 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 DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) by SN7PR11MB7706.namprd11.prod.outlook.com (2603:10b6:806:32c::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.27; Tue, 1 Oct 2024 12:17:21 +0000 Received: from DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::21e4:2d98:c498:2d7a]) by DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::21e4:2d98:c498:2d7a%4]) with mapi id 15.20.8005.026; Tue, 1 Oct 2024 12:17:20 +0000 Message-ID: <2403e226-ea18-4c61-bfd9-493249c9d7fb@intel.com> Date: Tue, 1 Oct 2024 14:17:14 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 01/17] memzone: fix use after free in tracing To: Stephen Hemminger , CC: Chengwen Feng , Tyler Retzlaff References: <20240927204742.546164-1-stephen@networkplumber.org> <20240930184600.7092-1-stephen@networkplumber.org> <20240930184600.7092-2-stephen@networkplumber.org> Content-Language: en-US From: "Burakov, Anatoly" In-Reply-To: <20240930184600.7092-2-stephen@networkplumber.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB7PR05CA0046.eurprd05.prod.outlook.com (2603:10a6:10:2e::23) To DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB6502:EE_|SN7PR11MB7706:EE_ X-MS-Office365-Filtering-Correlation-Id: def5aa1a-6275-43bf-14fd-08dce212ffb2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: =?utf-8?B?OUR0dlI2WWQ2dDNNa0p6VHBtUUtFMkQ4dEcyN09iUXBiUHVMdEduY1IzR2Vh?= =?utf-8?B?VGVuc0NIb2lrQWVhaUc5LzlmV0dXYzlBMktoRy96QmI3TGlhNG5pMTJJdjlm?= =?utf-8?B?T08vUndkQWUwU1BwTXI0d0hFZ2tZYkc3Y2t4L2VSS0RPWTNTUUdoSldaMGxW?= =?utf-8?B?RTRSeEd1UEtUekt2Tis4QmdMdUxjTkRIbUZ1R2JaSWVQWFhnWkMvQm5DeU9Y?= =?utf-8?B?QUNPbW5SN0gxZDNRdUdVbmxjMTFDODdkWTBscTdvZXFaSU8rbHRJOGcrQ1BI?= =?utf-8?B?Zm1CWWx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?VEFTNnF3NmhzeUlyamtiMVlTd0R1bTFVOG5QRWFEekxNT1FXTDVIYmRxTUs0?= =?utf-8?B?bXpsdk5uL283ZzRMSXk0VWQwV3VETWRHVGNhSUQvLzFZTUdycnJZZWFMRzhm?= =?utf-8?B?ZjY4cG4rZHFQNkZJNzRnTkM3cWdxb3Q5YzBodXBrWEl2dUpRMGdhWnd3SC9h?= =?utf-8?B?emx2VGp2MlpFM0R2VHQ2M1RQQzZGaXdrK09XUHg3Q3piZGplTjhEZWFrMG5j?= =?utf-8?B?NGMzQ2tTZjkyOHJUM0ZpVXNDTVd1ZjZ2UStOK0RhQ3VMMUMvUHl2aXZTd08z?= =?utf-8?B?NUV5eEhqS3BjRzdGbzZFbzE0VkFNTXRnazBVSXBHRUZnTjA1bmNVOHJNV3JM?= =?utf-8?B?alB5aTlXTGNIUSt4R213TWthbndGRHJFSzR1cVl2dnVvWGEzRStBMWFaR2gr?= =?utf-8?B?TXU3T204SlpuK1U1aXFINDJ5M1pPSHRldW42eVpnclEvR2R4L3lYdHRIOG5Z?= =?utf-8?B?aFQ1dDc0SHFMUUNFWU5PRnVnVCtxVitSQ3E1OWlySUdFZFhGS3FNcCtnPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB6502.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UmIxQWNmZytFV0Q4dG54U3RBejQrVE1tVzRUTFg5L2V1VGRlUVgwWTdoVDNi?= =?utf-8?B?Nkx4NXJIZUQ1enFPVGNHZGtMekVhVnlRc0p3MTcyb20rUlkzN3lZeGdKMVVN?= =?utf-8?B?dEZaWmd0RllsWHZleC9yV2o1MXZ3QitNVVJmdXJQOGNjSU5va2xNNi9hQ2xB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dwcDN6em93TUI2RjVuelhM?= =?utf-8?B?bXNQV1gxc2h3K1dpc0YwRWdVQndYUlZLK1RoRkpMaG50QXNnTUJhNGlrdUc5?= =?utf-8?B?Mm5aeHowUVhXcUQ2dFhXaE5NbjV3UGlFTElUZ0RCb3kzZ2Zqemh2bFZFc2Fr?= =?utf-8?B?aFlFTENQd2thd2NUUXVkQXpza1lJa1pSdE5uYjk3M3pDdkVwcHdmU29xQSsz?= =?utf-8?B?QWc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: def5aa1a-6275-43bf-14fd-08dce212ffb2 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB6502.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Oct 2024 12:17:20.9269 (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: nRD3S+9W1fSgJlj46dK3e3xVlWqKh6so/AJyaJ0fFO5mZYZkyAn6GOKK76H2OVKJhmp8SagNgd8hvfTgt+d5rfzcNexmPj8hIt8hw9jhAaY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7706 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 9/30/2024 8:43 PM, Stephen Hemminger wrote: > Using the freed value for tracing is not a good idea. > Although it is harmless for tracing, it will cause analyzers to flag > this as unsafe. > > Signed-off-by: Stephen Hemminger > Acked-by: Chengwen Feng > --- > lib/eal/common/eal_common_memzone.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/lib/eal/common/eal_common_memzone.c b/lib/eal/common/eal_common_memzone.c > index 2d9b6aa3e3..90efbb621d 100644 > --- a/lib/eal/common/eal_common_memzone.c > +++ b/lib/eal/common/eal_common_memzone.c > @@ -331,9 +331,10 @@ rte_memzone_free(const struct rte_memzone *mz) > > rte_rwlock_write_unlock(&mcfg->mlock); > > + rte_eal_trace_memzone_free(name, addr, ret); > + > rte_free(addr); > > - rte_eal_trace_memzone_free(name, addr, ret); > return ret; > } > Acked-by: Anatoly Burakov -- Thanks, Anatoly