brintos

brintos / linux-shallow public Read only

0
0
Text · 2.2 KiB · f00f7a1 Raw
56 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3=============4TPM Event Log5=============6 7This document briefly describes what TPM log is and how it is handed8over from the preboot firmware to the operating system.9 10Introduction11============12 13The preboot firmware maintains an event log that gets new entries every14time something gets hashed by it to any of the PCR registers. The events15are segregated by their type and contain the value of the hashed PCR16register. Typically, the preboot firmware will hash the components to17who execution is to be handed over or actions relevant to the boot18process.19 20The main application for this is remote attestation and the reason why21it is useful is nicely put in the very first section of [1]:22 23"Attestation is used to provide information about the platform’s state24to a challenger. However, PCR contents are difficult to interpret;25therefore, attestation is typically more useful when the PCR contents26are accompanied by a measurement log. While not trusted on their own,27the measurement log contains a richer set of information than do the PCR28contents. The PCR contents are used to provide the validation of the29measurement log."30 31UEFI event log32==============33 34UEFI provided event log has a few somewhat weird quirks.35 36Before calling ExitBootServices() Linux EFI stub copies the event log to37a custom configuration table defined by the stub itself. Unfortunately,38the events generated by ExitBootServices() don't end up in the table.39 40The firmware provides so called final events configuration table to sort41out this issue. Events gets mirrored to this table after the first time42EFI_TCG2_PROTOCOL.GetEventLog() gets called.43 44This introduces another problem: nothing guarantees that it is not called45before the Linux EFI stub gets to run. Thus, it needs to calculate and save the46final events table size while the stub is still running to the custom47configuration table so that the TPM driver can later on skip these events when48concatenating two halves of the event log from the custom configuration table49and the final events table.50 51References52==========53 54- [1] https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/55- [2] The final concatenation is done in drivers/char/tpm/eventlog/efi.c56