aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/security
diff options
context:
space:
mode:
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2019-07-12 11:44:32 -0400
committerJonathan Corbet <corbet@lwn.net>2019-07-31 15:37:29 -0400
commit2ef5a7f1482c21579d556f31a605a7ca32f251e7 (patch)
tree6897054fd25bf3862ae2d0efc2df3edeffb4f066 /Documentation/security
parente15d5a53ea3239e537d3a0c4bdfce8a4ea4e0da6 (diff)
tpm: Document UEFI event log quirks
There are some weird quirks when it comes to UEFI event log. Provide a brief introduction to TPM event log mechanism and describe the quirks and how they can be sorted out. Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/security')
-rw-r--r--Documentation/security/tpm/index.rst1
-rw-r--r--Documentation/security/tpm/tpm_event_log.rst55
2 files changed, 56 insertions, 0 deletions
diff --git a/Documentation/security/tpm/index.rst b/Documentation/security/tpm/index.rst
index 3296533e54cf..2bae8e8ca4bc 100644
--- a/Documentation/security/tpm/index.rst
+++ b/Documentation/security/tpm/index.rst
@@ -4,5 +4,6 @@ Trusted Platform Module documentation
4 4
5.. toctree:: 5.. toctree::
6 6
7 tpm_event_log
7 tpm_vtpm_proxy 8 tpm_vtpm_proxy
8 xen-tpmfront 9 xen-tpmfront
diff --git a/Documentation/security/tpm/tpm_event_log.rst b/Documentation/security/tpm/tpm_event_log.rst
new file mode 100644
index 000000000000..f00f7a1d5e92
--- /dev/null
+++ b/Documentation/security/tpm/tpm_event_log.rst
@@ -0,0 +1,55 @@
1.. SPDX-License-Identifier: GPL-2.0
2
3=============
4TPM Event Log
5=============
6
7This document briefly describes what TPM log is and how it is handed
8over from the preboot firmware to the operating system.
9
10Introduction
11============
12
13The preboot firmware maintains an event log that gets new entries every
14time something gets hashed by it to any of the PCR registers. The events
15are segregated by their type and contain the value of the hashed PCR
16register. Typically, the preboot firmware will hash the components to
17who execution is to be handed over or actions relevant to the boot
18process.
19
20The main application for this is remote attestation and the reason why
21it is useful is nicely put in the very first section of [1]:
22
23"Attestation is used to provide information about the platform’s state
24to a challenger. However, PCR contents are difficult to interpret;
25therefore, attestation is typically more useful when the PCR contents
26are accompanied by a measurement log. While not trusted on their own,
27the measurement log contains a richer set of information than do the PCR
28contents. The PCR contents are used to provide the validation of the
29measurement log."
30
31UEFI event log
32==============
33
34UEFI provided event log has a few somewhat weird quirks.
35
36Before calling ExitBootServices() Linux EFI stub copies the event log to
37a 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 sort
41out this issue. Events gets mirrored to this table after the first time
42EFI_TCG2_PROTOCOL.GetEventLog() gets called.
43
44This introduces another problem: nothing guarantees that it is not called
45before the Linux EFI stub gets to run. Thus, it needs to calculate and save the
46final events table size while the stub is still running to the custom
47configuration table so that the TPM driver can later on skip these events when
48concatenating two halves of the event log from the custom configuration table
49and the final events table.
50
51References
52==========
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.c