Skip to contentSkip to conversation

Patch "x86/ioapic: Pass the correct data to unmask_ioapic_irq()" has been added to the 4.12-stable tree

PATCH [email protected] 1 participant 1 message Jul 25, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

x86/ioapic: Pass the correct data to unmask_ioapic_irq()

to the 4.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
x86-ioapic-pass-the-correct-data-to-unmask_ioapic_irq.patch
and it can be found in the queue-4.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From e708e35ba6d89ff785b225cd07dcccab04fa954a Mon Sep 17 00:00:00 2001

From: Seunghun Han <[email protected]>
Date: Tue, 18 Jul 2017 18:20:44 +0900
Subject: x86/ioapic: Pass the correct data to unmask_ioapic_irq()

From: Seunghun Han <[email protected]>

commit e708e35ba6d89ff785b225cd07dcccab04fa954a upstream.

One of the rarely executed code pathes in check_timer() calls unmask_ioapic_irq() passing irq_get_chip_data(0) as argument.

That's wrong as unmask_ioapic_irq() expects a pointer to the irq data of interrupt 0. irq_get_chip_data(0) returns NULL, so the following dereference in unmask_ioapic_irq() causes a kernel panic.

The issue went unnoticed in the first place because irq_get_chip_data() returns a void pointer so the compiler cannot do a type check on the argument. The code path was added for machines with broken configuration, but it seems that those machines are either not running current kernels or simply do not longer exist.

Hand in irq_get_irq_data(0) as argument which provides the correct data.

[ tglx: Rewrote changelog ]

Fixes 4467715a44cc ("x86/irq: Move irq_cfg.irq_2_pin into io_apic.c")
---
 arch/x86/kernel/apic/io_apic.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/apic/io_apic.c +1 -1
@@ -2115,7 +2115,7 @@ static inline void __init check_timer(vo
 			int idx;
 			idx = find_irq_entry(apic1, pin1, mp_INT);
 			if (idx != -1 && irq_trigger(idx))
-				unmask_ioapic_irq(irq_get_chip_data(0));
+				unmask_ioapic_irq(irq_get_irq_data(0));
 		}
 		irq_domain_deactivate_irq(irq_data);
 		irq_domain_activate_irq(irq_data);

Patches currently in stable-queue which might be from [email protected] are

queue-4.12/x86-ioapic-pass-the-correct-data-to-unmask_ioapic_irq.patch queue-4.12/x86-acpi-prevent-out-of-bound-access-caused-by-broken-acpi-tables.patch