Blame SOURCES/0156-TPM-Fix-hash_log_extend_event-function-prototype.patch

8631a2
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
8631a2
From: Hans de Goede <hdegoede@redhat.com>
8631a2
Date: Fri, 15 Jun 2018 09:25:00 +0200
8631a2
Subject: [PATCH] TPM: Fix hash_log_extend_event function prototype
8631a2
8631a2
The DataToHash argument is a efi_physical_address, not a *pointer* to
8631a2
a efi_physical_address.
8631a2
8631a2
This distinction is important for 32 bits builds, where the pointer is
8631a2
only 32 bits where as an efi_physical_address is 64 bits.
8631a2
8631a2
Fixing this fixes the tpm code not working with 32 bits build and grub
8631a2
showing multiple:
8631a2
8631a2
error: Invalid parameter
8631a2
8631a2
Messages during boot, followed by a "press any key to continue" message.
8631a2
8631a2
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8631a2
---
8631a2
 grub-core/kern/efi/tpm.c | 2 +-
8631a2
 include/grub/efi/tpm.h   | 2 +-
8631a2
 2 files changed, 2 insertions(+), 2 deletions(-)
8631a2
8631a2
diff --git a/grub-core/kern/efi/tpm.c b/grub-core/kern/efi/tpm.c
f6e916
index c9fb3c133..36e1f69df 100644
8631a2
--- a/grub-core/kern/efi/tpm.c
8631a2
+++ b/grub-core/kern/efi/tpm.c
8631a2
@@ -245,7 +245,7 @@ grub_tpm2_log_event(grub_efi_handle_t tpm_handle, unsigned char *buf,
8631a2
   event->Size = sizeof(*event) - sizeof(event->Event) + grub_strlen(description) + 1;
8631a2
   grub_memcpy(event->Event, description, grub_strlen(description) + 1);
8631a2
 
8631a2
-  status = efi_call_5 (tpm->hash_log_extend_event, tpm, 0, buf,
8631a2
+  status = efi_call_5 (tpm->hash_log_extend_event, tpm, 0, (unsigned long) buf,
8631a2
 		       (grub_uint64_t) size, event);
8631a2
 
8631a2
   switch (status) {
8631a2
diff --git a/include/grub/efi/tpm.h b/include/grub/efi/tpm.h
f6e916
index e2aff4a3c..63d8a0fe7 100644
8631a2
--- a/include/grub/efi/tpm.h
8631a2
+++ b/include/grub/efi/tpm.h
8631a2
@@ -129,7 +129,7 @@ struct grub_efi_tpm2_protocol
8631a2
 				      grub_efi_boolean_t *EventLogTruncated);
8631a2
   grub_efi_status_t (*hash_log_extend_event) (struct grub_efi_tpm2_protocol *this,
8631a2
 					      grub_efi_uint64_t Flags,
8631a2
-					      grub_efi_physical_address_t *DataToHash,
8631a2
+					      grub_efi_physical_address_t DataToHash,
8631a2
 					      grub_efi_uint64_t DataToHashLen,
8631a2
 					      EFI_TCG2_EVENT *EfiTcgEvent);
8631a2
   grub_efi_status_t (*submit_command) (struct grub_efi_tpm2_protocol *this,