]> git.baikalelectronics.ru Git - kernel.git/commit
x86/acpi: Prevent out of bound access caused by broken ACPI tables
authorSeunghun Han <kkamagui@gmail.com>
Tue, 18 Jul 2017 11:03:51 +0000 (20:03 +0900)
committerIngo Molnar <mingo@kernel.org>
Thu, 20 Jul 2017 08:27:59 +0000 (10:27 +0200)
commite259919c40ea182b3e2b35c3d4f4a5efa7b197c5
tree059f12b39e9be8cf55fabb631d8e57df283f5ff5
parentc4b74c7b6e7181a0df479eed5dfeb461fea97955
x86/acpi: Prevent out of bound access caused by broken ACPI tables

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 ]

Signed-off-by: Seunghun Han <kkamagui@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: security@kernel.org
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: stable@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/acpi/boot.c