grub/grub-core/commands
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
..
arc
efi tpm: Fix bug in GRUB2 TPM module 2020-09-21 16:43:54 -04:00
i386 verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
ieee1275
mips/loongson
xen
acpi.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
acpihalt.c
blocklist.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
boot.c
boottime.c
cacheinfo.c
cat.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
cmp.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
configfile.c
date.c
echo.c
eval.c
extcmd.c
file.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
file32.c
file64.c
fileXX.c
fwconfig.c
gptprio.c disk: Update grub_gpt_partentry 2020-09-21 13:19:10 -04:00
gptrepair.c
gptsync.c
halt.c
hashsum.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
hdparm.c
help.c
hexdump.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
iorw.c
keylayouts.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
keystatus.c
legacycfg.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
loadenv.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
ls.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
lsacpi.c
lsmmap.c
lspci.c
macbless.c
memrw.c
menuentry.c core: use GRUB_TERM_ definitions when handling term characters 2020-09-21 12:02:37 -04:00
minicmd.c dl: Add support for persistent modules 2020-09-21 13:46:34 -04:00
nativedisk.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
parttool.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
password.c
password_pbkdf2.c
pcidump.c
pgp.c pgp: Fix emu build and tests after pgp module renaming 2020-09-21 16:43:54 -04:00
probe.c
read.c
reboot.c
regexp.c
search.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
search_disk_uuid.c
search_file.c
search_label.c
search_part_label.c
search_part_uuid.c
search_uuid.c
search_wrap.c
setpci.c
sleep.c
smbios.c
syslinuxcfg.c
terminal.c
test.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
testload.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
testspeed.c verifiers: File type for fine-grained signature-verification controlling 2020-09-21 13:29:05 -04:00
time.c
tpm.c verifiers: Core TPM support 2020-09-21 16:43:54 -04:00
tr.c
true.c
usbtest.c
verifiers.c verifiers: Add possibility to defer verification to other verifiers 2020-09-21 13:46:34 -04:00
videoinfo.c
videotest.c
wildcard.c
xnu_uuid.c