Skip to content
Commit ac909ec3 authored by Petr Vandrovec's avatar Petr Vandrovec Committed by Len Brown
Browse files

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: default avatarPetr Vandrovec <petr@vmware.com>
Signed-off-by: default avatarAlok N Kataria <akataria@vmware.com>
Reviewed-by: default avatarToshi Kani <toshi.kani@hp.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent c80f5b31
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment