grub/grub-core/commands/efi
Max Tottenham f8d1ad2678 tpm: Fix bug in GRUB2 TPM module
The value of tpm_handle changes between successive calls to grub_tpm_handle_find(),
as instead of simply copying the stored pointer we end up taking the address of
said pointer when using the cached value of grub_tpm_handle.

This causes grub_efi_open_protocol() to return a nullptr in grub_tpm2_execute()
and grub_tpm2_log_event(). Said nullptr goes unchecked and
efi_call_5(tpm->hash_log_extend_event,...) ends up jumping to 0x0, Qemu crashes
once video ROM is reached at 0xb0000.

This patch seems to do the trick of fixing that bug, but we should also ensure
that all calls to grub_efi_open_protocol() are checked so that we don't start
executing low memory.

Signed-off-by: Max Tottenham <mtottenh@akamai.com>
Reviewed-by: Matthew Garrett <mjg59@google.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2019-01-21 11:22:36 +01:00
..
efifwsetup.c * grub-core/Makefile.core.def (efifwsetup): New module. 2012-09-08 09:40:24 +02:00
fixvideo.c Remove nested functions from PCI iterators. 2013-01-13 01:10:41 +00:00
loadbios.c verifiers: File type for fine-grained signature-verification controlling 2018-11-09 13:25:31 +01:00
lsefi.c Fix a segfault in lsefi 2017-08-03 20:03:09 +02:00
lsefimmap.c lsefimmap: support persistent memory and other UEFI 2.5 features 2015-12-17 21:00:44 +03:00
lsefisystab.c lsefisystab: add missing comma after 7994077 2015-11-17 06:27:17 +03:00
lssal.c * grub-core/commands/efi/lssal.c: Fix terminating condition. 2013-12-11 15:59:12 +01:00
shim_lock.c efi: Add EFI shim lock verifier 2018-11-09 13:25:31 +01:00
tpm.c tpm: Fix bug in GRUB2 TPM module 2019-01-21 11:22:36 +01:00