OSDN Git Service

tpm: Reserve the TPM final events table
authorMatthew Garrett <mjg59@google.com>
Mon, 20 May 2019 20:54:59 +0000 (13:54 -0700)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Mon, 24 Jun 2019 20:57:49 +0000 (23:57 +0300)
commitc46f3405692de1ac82240d927b9c7a0f9d6a4a36
treea7b4937f49900d4c1f46104326fe9b96b38cfbcf
parent44038bc514a244fba9d0d6d698b15970185ac251
tpm: Reserve the TPM final events table

UEFI systems provide a boot services protocol for obtaining the TPM
event log, but this is unusable after ExitBootServices() is called.
Unfortunately ExitBootServices() itself triggers additional TPM events
that then can't be obtained using this protocol. The platform provides a
mechanism for the OS to obtain these events by recording them to a
separate UEFI configuration table which the OS can then map.

Unfortunately this table isn't self describing in terms of providing its
length, so we need to parse the events inside it to figure out how long
it is. Since the table isn't mapped at this point, we need to extend the
length calculation function to be able to map the event as it goes
along.

(Fixes by Bartosz Szczepanek <bsz@semihalf.com>)

Signed-off-by: Matthew Garrett <mjg59@google.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Bartosz Szczepanek <bsz@semihalf.com>
Tested-by: Bartosz Szczepanek <bsz@semihalf.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
drivers/char/tpm/eventlog/tpm2.c
drivers/firmware/efi/efi.c
drivers/firmware/efi/tpm.c
include/linux/efi.h
include/linux/tpm_eventlog.h