Skip to content

Commit e07db0d

Browse files
KAGA-KOKOgregkh
authored andcommitted
genirq: Fix chained interrupt data ordering
commit 2c4569ca26986d18243f282dd727da27e9adae4c 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>
1 parent 1736f2b commit e07db0d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/irq/chip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,8 +810,8 @@ irq_set_chained_handler_and_data(unsigned int irq, irq_flow_handler_t handle,
810810
if (!desc)
811811
return;
812812

813-
__irq_do_set_handler(desc, handle, 1, NULL);
814813
desc->irq_common_data.handler_data = data;
814+
__irq_do_set_handler(desc, handle, 1, NULL);
815815

816816
irq_put_desc_busunlock(desc, flags);
817817
}

0 commit comments

Comments
 (0)