]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-boot: Remove unnecessary call to GetEventLog
authorJoe Richey <joerichey@google.com>
Fri, 31 May 2019 18:24:20 +0000 (11:24 -0700)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 3 Jun 2019 13:47:09 +0000 (15:47 +0200)
commitf8e54bf31970d9988bf05e70f75a3e05187f4e30
tree58bc60bb987e8ca0179f7bb578abba498b075f5e
parent741c73c0766b51d10c26113f49fce81f2c2baff9
sd-boot: Remove unnecessary call to GetEventLog

This PR reverts #4302 and part of #7568, as the call to GetEventLog
isn't necessary to get the logs from the OS runtime.

This has already been reverted in shim, see:
    https://github.com/rhboot/shim/commit/fd7c3bd920ba39082cb7c619afb7203d150a4cd3

The reasoning for the change that added this is wrong, explained below:

> According to TCG EFI Protocol Specification for TPM 2.0 family,
> all events generated after the invocation of EFI_TCG2_GET_EVENT_LOG
> shall be stored in an instance of an EFI_CONFIGURATION_TABLE aka
> EFI TCG 2.0 final events table.

This is correct and a valid reading of the TCG spec.

> Hence, it is necessary to trigger the internal switch through calling
> get_event_log() in order to allow to retrieve the logs from OS runtime.

However, this reasoning is incorrect. The "EFI TCG 2.0 final events
table" exists to allow the OS Runtime to get TCG events created during
or after the call to ExitBootServices. If systemd-boot didn't call
trigger_tcg2_final_events_table(), the call to HashLogExtendEvent will
write the event to the normal events table (i.e. the same place the
PCR 0 - 7 related events are written). Then the OS can obtain these
systemd-boot events in the same way it obtains normal events, via a
call to GetEventLog().

Tested on amd64 w/ TPM2 using the newest Linux kernel patches that
get the TPM2 formatted log:
    https://www.lkml.org/lkml/2019/5/20/1590
I confirmed that this change still lets the OS runtime obtain the log
entries created by systemd-boot.

Signed-off-by: Joe Richey <joerichey@google.com>
src/boot/efi/measure.c