diff options
| author | Richard Patel <ripatel@wii.dev> | 2026-10-09 14:58:41 +0000 |
|---|---|---|
| committer | Thomas Gleixner <tglx@kernel.org> | 2026-10-16 00:18:40 +0200 |
| commit | d04adff6860587e843948b0c31174f8ae11b8dfe (patch) | |
| tree | fa43c01f1b087d4b4112b88923b3070411ae913c /scripts/Makefile.thinlto | |
| parent | feb5c9a2447a7d65a17d949c81c1f21864cde172 (diff) | |
| download | linux-d04adff6860587e843948b0c31174f8ae11b8dfe.tar.gz linux-d04adff6860587e843948b0c31174f8ae11b8dfe.zip | |
genirq: Defer kfree(irqaction) until irq_thread_dtor() finishes
When an interrupt thread exits abnormally via do_exit() (e.g. the interrupt
handler oopses) without returning from irq_thread(), a concurrent call to
free_irq() could free the irqaction before the irq_thread_dtor() exit task
work runs.
irq thread (oopsed) free_irq()
------------------- ----------
do_exit()
exit_mm()
complete_vfork_done() -------> kthread_stop() returns
exit_files() ... kfree(action)
exit_task_work()
irq_thread_dtor()
action->... <- use-after-free
Track the pending exit work with the IRQTF_EXIT_WORK thread flag, and have
__free_irq() wait for the bit to clear before kfree().
irq_thread_dtor() only runs on irq_thread abnormal exit. If that dtor also
faults, free_irq() will hang indefinitely, but double IRQ thread faults
require a reboot anyways.
[ tglx: Add missing include ]
Fixes: ed3e694d78cc ("move exit_task_work() past exit_files() et.al.")
Signed-off-by: Richard Patel <ripatel@wii.dev>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20261009145842.1616117-2-ripatel@wii.dev
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
