Re: [PATCH] irq_work: Fix use-after-free in irq_work_run_cpu() on PREEMPT_RT

From: Sebastian Andrzej Siewior

Date: Tue Dec 01 2026 - 03:05:33 EST


On 2026-11-30 10:34:10 [+0100], Andrea Parri wrote:
> On PREEMPT_RT, irq_work_sync() on a !IRQ_WORK_HARD_IRQ item waits for
> IRQ_WORK_BUSY to clear and then calls synchronize_rcu(), because
…
> Sashiko reported this on v1 of the series [1] and Sebastian acknowledged
> it [2], but the patch was applied unchanged.

Yeah. I sort was thinking to lift the restriction somehow but didn't so
far. Do you think you can shrink the commit message to something
readable?
The sense itself makes sense.

> diff --git a/kernel/irq_work.c b/kernel/irq_work.c
> index 73eabcbdcd50c..121f604569d17 100644
> --- a/kernel/irq_work.c
> +++ b/kernel/irq_work.c
> @@ -271,6 +271,7 @@ void irq_work_run_cpu(unsigned int cpu)
> if (!IS_ENABLED(CONFIG_PREEMPT_RT))
> return;
>
> + guard(rcu)();
> irq_work_run_list(per_cpu_ptr(&lazy_list, cpu));
> }
>

Sebastian