grub/grub-core/commands/efi
Max Tottenham 019c0941b8 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>
2020-09-21 16:43:54 -04: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
getenv.c Fix hex representation of binary variable contents 2016-01-07 15:31:36 -08:00
loadbios.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
lsefi.c Fix a segfault in lsefi 2020-09-21 11:32:45 -04:00
lsefimmap.c lsefimmap: support persistent memory and other UEFI 2.5 features 2015-12-17 21:00:44 +03:00
lsefisystab.c Add smbios command 2016-01-06 12:46:22 -08: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 2020-09-21 13:46:34 -04:00
smbios.c Add smbios command 2016-01-06 12:46:22 -08:00
tpm.c tpm: Fix bug in GRUB2 TPM module 2020-09-21 16:43:54 -04:00