blob: 488dd546f13fdc110e699b25424d7fece38fdae8 [file] [log] [blame]
Eddie Jamesfb1c10e2023-10-24 10:43:52 -05001.. SPDX-License-Identifier: GPL-2.0+
2
3Measured Boot
Heinrich Schuchardtb72160b2023-10-28 11:59:32 +02004=============
Eddie Jamesfb1c10e2023-10-24 10:43:52 -05005
6U-Boot can perform a measured boot, the process of hashing various components
7of the boot process, extending the results in the TPM and logging the
8component's measurement in memory for the operating system to consume.
9
Ilias Apalodimasd29e89f2024-06-14 15:14:03 +030010The functionality is available when booting via the EFI subsystem or 'bootm'
11command.
12
13UEFI measured boot
14------------------
15
16The EFI subsystem implements the `EFI TCG protocol
17<https://trustedcomputinggroup.org/resource/tcg-efi-protocol-specification/>`_
18and the `TCG PC Client Specific Platform Firmware Profile Specification
19<https://trustedcomputinggroup.org/resource/pc-client-specific-platform-firmware-profile-specification/>`_
20which defines the binaries to be measured and the corresponding PCRs to be used.
21
22Requirements
23~~~~~~~~~~~~
24
25* A hardware TPM 2.0 supported by an enabled U-Boot driver
26* CONFIG_EFI_TCG2_PROTOCOL=y
Ilias Apalodimasd29e89f2024-06-14 15:14:03 +030027* optional CONFIG_EFI_TCG2_PROTOCOL_MEASURE_DTB=y will measure the loaded DTB
28 in PCR 1
29
30Legacy measured boot
31--------------------
32
33The commands booti, bootm, and bootz can be used for measured boot
34using the legacy entry point of the Linux kernel.
35
Eddie Jamesfb1c10e2023-10-24 10:43:52 -050036By default, U-Boot will measure the operating system (linux) image, the
37initrd image, and the "bootargs" environment variable. By enabling
Ilias Apalodimasd29e89f2024-06-14 15:14:03 +030038CONFIG_MEASURE_DEVICETREE, U-Boot will also measure the devicetree image in PCR1.
Eddie Jamesfb1c10e2023-10-24 10:43:52 -050039
40The operating system typically would verify that the hashes found in the
41TPM PCRs match the contents of the event log. This can further be checked
42against the hash results of previous boots.
43
44Requirements
Ilias Apalodimasd29e89f2024-06-14 15:14:03 +030045~~~~~~~~~~~~
Eddie Jamesfb1c10e2023-10-24 10:43:52 -050046
Ilias Apalodimasd29e89f2024-06-14 15:14:03 +030047* A hardware TPM 2.0 supported by an enabled U-Boot driver
48* CONFIG_TPMv2=y
Eddie Jamesfb1c10e2023-10-24 10:43:52 -050049* CONFIG_MEASURED_BOOT=y
50* Device-tree configuration of the TPM device to specify the memory area
51 for event logging. The TPM device node must either contain a phandle to
52 a reserved memory region or "linux,sml-base" and "linux,sml-size"
53 indicating the address and size of the memory region. An example can be
54 found in arch/sandbox/dts/test.dts
55* The operating system must also be configured to use the memory regions
56 specified in the U-Boot device-tree in order to make use of the event
57 log.