OpenCloudOS-Kernel/drivers/firmware/efi/libstub
Matthew Garrett 166a2809d6 tpm: Don't duplicate events from the final event log in the TCG2 log
After the first call to GetEventLog() on UEFI systems using the TCG2
crypto agile log format, any further log events (other than those
triggered by ExitBootServices()) will be logged in both the main log and
also in the Final Events Log. While the kernel only calls GetEventLog()
immediately before ExitBootServices(), we can't control whether earlier
parts of the boot process have done so. This will result in log entries
that exist in both logs, and so the current approach of simply appending
the Final Event Log to the main log will result in events being
duplicated.

We can avoid this problem by looking at the size of the Final Event Log
just before we call ExitBootServices() and exporting this to the main
kernel. The kernel can then skip over all events that occured before
ExitBootServices() and only append events that were not also logged to
the main log.

Signed-off-by: Matthew Garrett <mjg59@google.com>
Reported-by: Joe Richey <joerichey@google.com>
Suggested-by: Joe Richey <joerichey@google.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
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>
2019-06-24 23:57:50 +03:00
..
Makefile arm64 updates for 5.2 2019-05-06 17:54:22 -07:00
arm-stub.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
arm32-stub.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
arm64-stub.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
efi-stub-helper.c Abstract out support for locating an EFI config table 2019-06-24 23:57:49 +03:00
efistub.h Abstract out support for locating an EFI config table 2019-06-24 23:57:49 +03:00
fdt.c Abstract out support for locating an EFI config table 2019-06-24 23:57:49 +03:00
gop.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
random.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
secureboot.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
string.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tpm.c tpm: Don't duplicate events from the final event log in the TCG2 log 2019-06-24 23:57:50 +03:00