From: Petr Vandrovec Date: Thu, 8 Mar 2012 21:33:24 +0000 (-0800) Subject: ACPI: Fix use-after-free in acpi_map_lsapic X-Git-Tag: v3.4-rc1~18^2~3^7~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac909ec308ce8d5177963c780564824d12bc3fa2;p=pandora-kernel.git 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 Signed-off-by: Alok N Kataria Reviewed-by: Toshi Kani Signed-off-by: Len Brown --- Reading git-diff-tree failed