From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC8E64035D4 for ; Wed, 25 Mar 2026 17:43:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774460638; cv=none; b=FmuJwRUdKJgi1ZDNzR1u15GAMlD4djtvZg0QfT7xZK8uIUcn8/ZlKH7TtuL8G0v6vG2eW3dIaJxnWniCRDU07dPwSQxAzeLhqLlIPKaJNPVT/zx1Oq+58qrZ3+aEgmhjAxoO+4s7gYL635WQzZ11zwCz7jXxrtSAcJgr49kh12g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774460638; c=relaxed/simple; bh=ABdnxvJrLXIyqtBD2+XtQ/hPq2DwqVVUrdozkPzvrqg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kfTDlj/93BsX2qbDNaePQUW8a2WoUwvDkIkH0QrRgwUy2n51zvhRWMXWEIHBKxbvtXC3MWsBtbZoKCbCOTS5mIti9MpoIMBPDPnzuiYGXv+I9W4Lz2lXdgFtiOYj9hq9gkqvK9M0UHiDLhif49SBA+iFcop2TMBvMXiB+X3BhV8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=goodmis.org; spf=pass smtp.mailfrom=goodmis.org; arc=none smtp.client-ip=216.40.44.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=goodmis.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=goodmis.org Received: from omf12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id D28DD5B791; Wed, 25 Mar 2026 17:43:50 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: rostedt@goodmis.org) by omf12.hostedemail.com (Postfix) with ESMTPA id 078DD17; Wed, 25 Mar 2026 17:43:48 +0000 (UTC) Date: Wed, 25 Mar 2026 13:44:33 -0400 From: Steven Rostedt To: Sebastian Andrzej Siewior Cc: Jiayuan Chen , linux-rt-devel@lists.linux.dev, Clark Williams , linux-kernel@vger.kernel.org, "Paul E. McKenney" Subject: Re: [PATCH v1] irq_work: Fix use-after-free in irq_work_single on PREEMPT_RT Message-ID: <20260325134433.7d46507d@gandalf.local.home> In-Reply-To: <20260325170539.MHkr49jU@linutronix.de> References: <20260325030508.321405-1-jiayuan.chen@linux.dev> <20260325111351.1d38a0bc@gandalf.local.home> <20260325153826.EbSqlX_n@linutronix.de> <20260325115315.052e34ac@gandalf.local.home> <20260325155504.tm4zHWMI@linutronix.de> <5b6f6480-aa2d-4966-b3c7-6c719e915285@linux.dev> <20260325170539.MHkr49jU@linutronix.de> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Stat-Signature: qiakmkmbtjrpdnuxr7at5ubwkppcer8b X-Rspamd-Server: rspamout01 X-Rspamd-Queue-Id: 078DD17 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Session-ID: U2FsdGVkX188j2HV6DzMYPqJOtQU0fgnQnkmc/utOtc= X-HE-Tag: 1774460628-368407 X-HE-Meta: U2FsdGVkX1+WJQCw4KJe1rZXF5reKf8O5A48UUZxO8XarKMD2Tjk/p2TobYKXWLDeALj92mgbq9aKgue3virLkpA2sZbS24/iwc2LVEJcmV3mZeqjGlYD+LIOsv5ptpu2jinvVF6DjLmwgdDArfkO1sF1vmZyP0MkEAGB06NwKWKJxCvWXty2uu80hCdHMUK6deFWpmPB7ooX9gMSvysVGYjLbJ4Sj4MjZ9yuMhMv2TxZQ4YZgD57qyH6juKvbzqxm+MAzDfg7WeTpo1KINy29PHGOlRYMDnu/mWeI5GodRTJGTCLOLzVC80BrSQG4Hm On Wed, 25 Mar 2026 18:05:39 +0100 Sebastian Andrzej Siewior wrote: > Why not just having the synchronize_rcu()? > > > Callers that free the containing structure would switch to > > irq_work_synchronize_free(), or use kfree_rcu() if appropriate > > If we provide the irq_work_synchronize_free() then using kfree_rcu() > would sort of open code irq_work_synchronize_free() since we couldn't > simply replace synchronize_rcu() with something else and update the > irq_work core side (we would also have to update all users). I guess > that was Steven's idea in providing a helper for synchronisation. > Yeah, the helper was just document that free work needs synchronization. Perhaps Jiayuan's idea is better as it will not require modifying current callers and does fix the issue. But it would still need helper functions from RCU as I really do not think it's a good idea to open code the rcuwait logic. -- Steve