]> git.hungrycats.org Git - linux/commit
x86/ioapic: Prevent NULL pointer dereference in setup_ioapic_dest()
authorWerner Pawlitschko <werner.pawlitschko@arcor.de>
Tue, 27 Oct 2015 00:08:04 +0000 (09:08 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Nov 2015 22:37:32 +0000 (14:37 -0800)
commit1e801f3a2dbf3bfd85155526bc0acbc55e309627
treeb65638b91cf7f4784f122ebaeed5c98560b91097
parentf07476108d20bc143192d579bf468d0560ed5571
x86/ioapic: Prevent NULL pointer dereference in setup_ioapic_dest()

commit ababae44108b0e94b58eef6cb5bd830bd040a47f upstream.

Commit 4857c91f0d19 changed the way how irq affinity is setup in
setup_ioapic_dest() from using the core helper function to
unconditionally calling the irq_set_affinity() callback of the
underlying irq chip.

That results in a NULL pointer dereference for the rare case where the
underlying irq chip is lapic_chip which has no irq_set_affinity()
callback. lapic_chip is occasionally used for the timer interrupt (irq
0).

The fix is simple: Check the availability of the callback instead of
calling it unconditionally.

Fixes: 4857c91f0d19 "x86/ioapic: Force affinity setting in setup_ioapic_dest()"
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/apic/io_apic.c