mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
genirq: Fix chained interrupt data ordering
commit 2c4569ca26 upstream.
irq_set_chained_handler_and_data() sets up the chained interrupt and then
stores the handler data.
That's racy against an immediate interrupt which gets handled before the
store of the handler data happened. The handler will dereference a NULL
pointer and crash.
Cure it by storing handler data before installing the chained handler.
Reported-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1736f2b3de
commit
e07db0d720
@@ -810,8 +810,8 @@ irq_set_chained_handler_and_data(unsigned int irq, irq_flow_handler_t handle,
|
||||
if (!desc)
|
||||
return;
|
||||
|
||||
__irq_do_set_handler(desc, handle, 1, NULL);
|
||||
desc->irq_common_data.handler_data = data;
|
||||
__irq_do_set_handler(desc, handle, 1, NULL);
|
||||
|
||||
irq_put_desc_busunlock(desc, flags);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user