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 2629746806 for ; Tue, 27 May 2025 16:54:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 188E24066A; Tue, 27 May 2025 16:54:03 +0200 (CEST) Received: from fhigh-a2-smtp.messagingengine.com (fhigh-a2-smtp.messagingengine.com [103.168.172.153]) by mails.dpdk.org (Postfix) with ESMTP id A3BBA4027A; Tue, 27 May 2025 16:54:00 +0200 (CEST) Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 52E4F11400AD; Tue, 27 May 2025 10:54:00 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Tue, 27 May 2025 10:54:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1748357640; x=1748444040; bh=gRZV+flnnb3sEEkkAxsUn4dkNvxL0Mo2I3wxnl741+c=; b= Bt9MinZcrYCwXkonwxMR4d2jy3Mo0vbEQp+qfd/iLHGdk/wuUqqNo9rHP91hDU3m FD7v7rETP0zUkbCEPigjFOboZd5PxFyL6Lx7XuZswCSRTOBuwhpZkEkwiYg+wzpp WsPSfq2WYdWCLnUIo9QrLzReyIATJ+rLIVFXUAvwvltxzoL54ZZ27i2s1h1LVYhl lmEDy+PO2mUuOkYv/hEdi0rvXt3N//7jg/OZ3o8Uw+z4a8cpqum/pGIe0qR3ftS3 RQNRVKnrPzGpUMjBV+N3MuH4mpN08KWhyqGYZOw59Nbmzpi0uNTBvibY1fi45KCg TYhi3vnTlWwdjxME9td6BQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1748357640; x= 1748444040; bh=gRZV+flnnb3sEEkkAxsUn4dkNvxL0Mo2I3wxnl741+c=; b=W wxLNjgn7mffPJIKgh3admrHDpvDkmuuYkX2eWi/smhuLos7epH6aR+wZ8zAt/fsD NlVWt1JyBnv3qBM3uoTBbdayh99uSTyeh99+9vWZec8PLnidIr+c158nbF+7LsSw OBCOjKhoMU78HWiYBjLD8DvAqywu9b5AY+XgHfY7v41xWbbGEj+q+43ZnwwBoyj8 tVZK/JFo0Nil6ALisiM0BRb1af41CHAb1bEmJcyxZKrVwnVVZy4KuSJRUBU7Zgpb EGujNNWA3zSELFeONoGLfSMieIgeOWn3Jj9i/Cad8kh859qN22SVAODxFpaLqAbY m1oe2mnpgP9q2kphDfAPQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgddvtdeijeculddtuddrgeefvddrtd dtmdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggft fghnshhusghstghrihgsvgdpuffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftd dtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgj fhgggfgtsehtufertddttdejnecuhfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuc eothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecuggftrfgrthhtvghrnhepjedu veehieevuddutdevfffgtdegkeeuveejffejgedtgeegkefgvdeugfefkeejnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehm ohhnjhgrlhhonhdrnhgvthdpnhgspghrtghpthhtohephedpmhhouggvpehsmhhtphhouh htpdhrtghpthhtoheprhhuihdrfhgvrhhrvghirhgrudeshhdqphgrrhhtnhgvrhhsrdgt ohhmpdhrtghpthhtohepuggvvhesughpughkrdhorhhgpdhrtghpthhtohepshhtrggslh gvseguphgukhdrohhrghdprhgtphhtthhopegurghvihgurdhmrghrtghhrghnugesrhgv ughhrghtrdgtohhmpdhrtghpthhtohepkhhonhhsthgrnhhtihhnrdgrnhgrnhihvghvse hhuhgrfigvihdrtghomh X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 27 May 2025 10:53:58 -0400 (EDT) From: Thomas Monjalon To: Rui Ferreira Cc: dev@dpdk.org, stable@dpdk.org, David Marchand , Konstantin Ananyev Subject: Re: [PATCH v2] fix eal/linux: unregister alarm callback before free Date: Tue, 27 May 2025 16:53:57 +0200 Message-ID: <1969712.QZUTf85G27@thomas> In-Reply-To: <20250522155944.65342-1-rui.ferreira1@h-partners.com> References: <20250520160150.50401-1-rui.ferreira1@h-partners.com> <20250522155944.65342-1-rui.ferreira1@h-partners.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hello, Did you see the comment from David about fixing for Windows and FreeBSD at the same time? I think you just need to apply the same logic in 3 different places. If you cannot test all, that's OK to submit the changes without full coverage testing. Thank you 22/05/2025 17:59, Rui Ferreira: > This was flagged by Address sanitizer as a use after free. The > intr_handle ptr is shared between the main thread and the interrupt > thread. The interrupt thread can dereference the ptr after free (from > the alarm callback). free is called when the main thread cleans up. > > The interrupt thread never terminates (eal_intr_thread_main) so > use rte_intr_callback_unregister_sync during cleanup to > ensure the callback is removed before freeing the ptr. > > To be more defensive clear out the pointer and registration > variable if we can unregister. > > rte_intr_callback_unregister_sync may (optionally) use traces > so the alarm cleanup must happen before eal_trace_fini to avoid > accessing freed memory. > > Bugzilla ID: 1683 > > Signed-off-by: Rui Ferreira > --- > .mailmap | 1 + > lib/eal/linux/eal.c | 3 ++- > lib/eal/linux/eal_alarm.c | 9 ++++++++- > 3 files changed, 11 insertions(+), 2 deletions(-)