]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI: Fix use-after-free in acpi_map_lsapic
authorPetr Vandrovec <petr@vmware.com>
Thu, 8 Mar 2012 21:33:24 +0000 (13:33 -0800)
committerLen Brown <len.brown@intel.com>
Fri, 30 Mar 2012 07:31:58 +0000 (03:31 -0400)
commit0fdaeae1cba4db83a15aef13fd720e9b82d2efcd
tree490e9168b304a93606de30fe01c9c5b0dc9fbc32
parentb0a8539bf04b484f5d6737afceffc39b5b47c26f
ACPI: Fix use-after-free in acpi_map_lsapic

When processor is being hot-added to the system, acpi_map_lsapic invokes
ACPI _MAT method to find APIC ID and flags, verifies that returned structure
is indeed ACPI's local APIC structure, and that flags contain MADT_ENABLED
bit.  Then saves APIC ID, frees structure - and accesses structure when
computing arguments for acpi_register_lapic call.  Which sometime leads
to acpi_register_lapic call being made with second argument zero, failing
to bring processor online with error 'Unable to map lapic to logical cpu
number'.

As lapic->lapic_flags & ACPI_MADT_ENABLED was already confirmed to be non-zero
few lines above, we can just pass unconditional ACPI_MADT_ENABLED to the
acpi_register_lapic.

Signed-off-by: Petr Vandrovec <petr@vmware.com>
Signed-off-by: Alok N Kataria <akataria@vmware.com>
Reviewed-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
arch/x86/kernel/acpi/boot.c