UEFI TPM2

Date: 2017-03-29 04:28 am (UTC)
From: (Anonymous)
Hi Matthew,

I successfully combined your GRU2 TPM bootloader with Tiancore's fTPM-UEFI and IBM's user-space TPM suite. Now I'm in the last step of porting your TPM function calls into Linux kernel's exec() system call in order to trace all software launches and extends to the PCR. However, I've been working for 40 hours, yet couldn't successfully port your "grub_tpm_measure()" function inside exec().

The major problem is, in the kernel space, the entries of elf_system_table structure are invalid. Linux kernel initializes the elf system table structure within "efi.c" file's efi_systab_init() function. To use TPM like your GRUB2 does, I need to access efi->system_table->boottime->locate_handle() function pointer. But boottime pointer is an invalid memory address, so if I try to access locate_handle(), I get kernel panick.

Another issue is, your efi_boot_services_t structure's 'open_protocol' is a function pointer, whereas the Linux version is void* variable.

Lastly, in your GRUB2 code you said "grub_efi_image_handle" and "efi_system_table" will be filled out by the system upon booting, and I see that Linux kernel fills out efi_system_table in efi_systab_init() function in efi.c file. However, I can't find anywhere the kernel defines and fills in "grub_efi_image_handle",and you use this variable for the TPM's PCR extension.

Am I on a completely wrong track in using the EFI structure inside the kernel? Is that why my EFI_entries are invalid? Could you please give me tips just for once for porting your tpm_measure into the kernel? I don't know where to turn anymore..
From:
Anonymous
OpenID
Identity URL: 
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org


 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.

Profile

Matthew Garrett

About Matthew

Power management, mobile and firmware developer on Linux. Security developer at Google. Ex-biologist. @mjg59 on Twitter. Content here should not be interpreted as the opinion of my employer.

Expand Cut Tags

No cut tags