Re: [PATCH v1] irq_work: Fix use-after-free in irq_work_single on PREEMPT_RT

From: Steven Rostedt

Date: Wed Mar 25 2026 - 12:08:48 EST


On Wed, 25 Mar 2026 16:38:26 +0100
Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> wrote:

> Most irq-work aren't free()ed since they are static and remain around.
> There is no task assigned if there is no active waiter.
> Wouldn't it be easier to kfree_rcu() the struct using the irq-work?

I guess we should add some kind of helper then. Like tracepoints have.

tracepoint_synchronize_unregister()

Perhaps have a:

irq_work_synchronize_free();

Or something like that to let developers know that they just can't safely free a
structure that contains an irq_work?

-- Steve