• Ard Biesheuvel's avatar
    efistub/tpm: Use ACPI reclaim memory for event log to avoid corruption · 77d48d39
    Ard Biesheuvel authored
    The TPM event log table is a Linux specific construct, where the data
    produced by the GetEventLog() boot service is cached in memory, and
    passed on to the OS using an EFI configuration table.
    
    The use of EFI_LOADER_DATA here results in the region being left
    unreserved in the E820 memory map constructed by the EFI stub, and this
    is the memory description that is passed on to the incoming kernel by
    kexec, which is therefore unaware that the region should be reserved.
    
    Even though the utility of the TPM2 event log after a kexec is
    questionable, any corruption might send the parsing code off into the
    weeds and crash the kernel. So let's use EFI_ACPI_RECLAIM_MEMORY
    instead, which is always treated as reserved by the E820 conversion
    logic.
    
    Cc: <stable@vger.kernel.org>
    Reported-by: default avatarBreno Leitao <leitao@debian.org>
    Tested-by: default avatarUsama Arif <usamaarif642@gmail.com>
    Reviewed-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
    Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
    77d48d39
tpm.c 5.68 KB