Patch "x86/acpi: Prevent out of bound access caused by broken ACPI tables" has been added to the 4.9-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
x86/acpi: Prevent out of bound access caused by broken ACPI tables
to the 4.9-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-acpi-prevent-out-of-bound-access-caused-by-broken-acpi-tables.patch
and it can be found in the queue-4.9 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
dad5ab0db8deac535d03e3fe3d8f2892173fa6a4Mon Sep 17 00:00:00 2001
From: Seunghun Han <[email protected]>
Date: Tue, 18 Jul 2017 20:03:51 +0900
Subject: x86/acpi: Prevent out of bound access caused by broken ACPI tables
From: Seunghun Han <[email protected]>
commit dad5ab0db8deac535d03e3fe3d8f2892173fa6a4 upstream.
The bus_irq argument of mp_override_legacy_irq() is used as the index into the isa_irq_to_gsi[] array. The bus_irq argument originates from ACPI_MADT_TYPE_IO_APIC and ACPI_MADT_TYPE_INTERRUPT items in the ACPI tables, but is nowhere sanity checked.
That allows broken or malicious ACPI tables to overwrite memory, which might cause malfunction, panic or arbitrary code execution.
Add a sanity check and emit a warning when that triggers.
[ tglx: Added warning and rewrote changelog ]
--- arch/x86/kernel/acpi/boot.c | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/x86/kernel/acpi/boot.c +8 -0
@@ -338,6 +338,14 @@ static void __init mp_override_legacy_irstruct mpc_intsrc mp_irq;/* +* Check bus_irq boundary. +*/ +if (bus_irq >=NR_IRQS_LEGACY ) { +pr_warn ("Invalid bus_irq %u for legacy override\n" , bus_irq); +return ; + } + +/* * Convert 'gsi' to 'ioapic.pin'. */ ioapic =mp_find_ioapic (gsi);
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/x86-ioapic-pass-the-correct-data-to-unmask_ioapic_irq.patch queue-4.9/x86-acpi-prevent-out-of-bound-access-caused-by-broken-acpi-tables.patch