efi_loader: fix FinalEvents table if an EFI app invoked GetEventLog
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Thu, 18 Nov 2021 07:03:39 +0000 (09:03 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 20 Nov 2021 09:53:00 +0000 (10:53 +0100)
commit5ba0397049b4ad5e2e23e47a8ae412e2d9044c67
tree036fc12ccc2a0f5ffc6502189f8be9f12d5b60d3
parentdc52578d7b48342c04484184199831893a983cbf
efi_loader: fix FinalEvents table if an EFI app invoked GetEventLog

As described in the TCG spec [1] in sections 7.1.1 and 7.1.2 the FinalEvent
table should include events after GetEventLog has been called.  This
currently works for us as long as the kernel is the only EFI application
calling that.  Specifically we only implement what's described in 7.1.1.

So refactor the code a bit and support EFI application(s) calling
GetEventLog.  Events will now be logged in both the EventLog and FinalEvent
table as long as ExitBootServices haven't been invoked.

[1] https://trustedcomputinggroup.org/wp-content/uploads/EFI-Protocol-Specification-rev13-160330final.pdf

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
lib/efi_loader/efi_tcg2.c