]> rtime.felk.cvut.cz Git - hercules2020/nv-tegra/linux-4.4.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)
committermobile promotions <svcmobile_promotions@nvidia.com>
Fri, 19 Jan 2018 08:31:41 +0000 (00:31 -0800)
commit2a465bd4a674976a0998816bb132d42385f9b943
tree9d8a23c2a46b4acc3f0a440b78ecf602282af5e1
parent57f45b7d2ba16244c1f9087684a3ffc4a55c8e50
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 ]

Bug 2031795

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>
Change-Id: I370ace5a64b80dbe18f30a0dcc5a244a4658d780
Reviewed-on: https://git-master.nvidia.com/r/1639125
Reviewed-by: James Huang <jamehuang@nvidia.com>
Tested-by: James Huang <jamehuang@nvidia.com>
Reviewed-by: Hayden Du <haydend@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
arch/x86/kernel/acpi/boot.c