linux_dsm_epyc7002/drivers/firmware/efi/libstub
Ard Biesheuvel 79d3219d4e efi/libstub: Take noinitrd cmdline argument into account for devpath initrd
One of the advantages of using what basically amounts to a callback
interface into the bootloader for loading the initrd is that it provides
a natural place for the bootloader or firmware to measure the initrd
contents while they are being passed to the kernel.

Unfortunately, this is not a guarantee that the initrd will in fact be
loaded and its /init invoked by the kernel, since the command line may
contain the 'noinitrd' option, in which case the initrd is ignored, but
this will not be reflected in the PCR that covers the initrd measurement.

This could be addressed by measuring the command line as well, and
including that PCR in the attestation policy, but this locks down the
command line completely, which may be too restrictive.

So let's take the noinitrd argument into account in the stub, too. This
forces any PCR that covers the initrd to assume a different value when
noinitrd is passed, allowing an attestation policy to disregard the
command line if there is no need to take its measurement into account
for other reasons.

As Peter points out, this would still require the agent that takes the
measurements to measure a separator event into the PCR in question at
ExitBootServices() time, to prevent replay attacks using the known
measurement from the TPM log.

Cc: Peter Jones <pjones@redhat.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2020-02-23 21:59:42 +01:00
..
arm32-stub.c efi/libstub/arm: Make efi_entry() an ordinary PE/COFF entrypoint 2020-02-22 23:37:37 +01:00
arm64-stub.c efi/libstub: Use hidden visibility for all source files 2020-02-23 21:57:12 +01:00
arm-stub.c efi/libstub: Take noinitrd cmdline argument into account for devpath initrd 2020-02-23 21:59:42 +01:00
efi-stub-helper.c efi/libstub: Take noinitrd cmdline argument into account for devpath initrd 2020-02-23 21:59:42 +01:00
efistub.h efi/libstub: Take noinitrd cmdline argument into account for devpath initrd 2020-02-23 21:59:42 +01:00
fdt.c efi/libstub: Simplify efi_high_alloc() and rename to efi_allocate_pages() 2020-02-23 21:57:15 +01:00
file.c efi/libstub: Fix error message in handle_cmdline_files() 2020-02-23 21:57:31 +01:00
gop.c efi/libstub: Rename efi_call_early/_runtime macros to be more intuitive 2019-12-25 10:49:25 +01:00
hidden.h efi/libstub: Use hidden visibility for all source files 2020-02-23 21:57:12 +01:00
Makefile efi/libstub: Clean up command line parsing routine 2020-02-23 21:57:15 +01:00
mem.c efi/libstub: Describe efi_relocate_kernel() 2020-02-23 21:57:15 +01:00
pci.c efi: Allow disabling PCI busmastering on bridges during boot 2020-01-10 18:55:04 +01:00
random.c efi/libstub: Describe RNG functions 2020-02-23 21:57:19 +01:00
randomalloc.c efi/libstub: Move efi_random_alloc() into separate source file 2020-02-23 21:57:15 +01:00
secureboot.c efi/libstub: Rename efi_call_early/_runtime macros to be more intuitive 2019-12-25 10:49:25 +01:00
skip_spaces.c efi/libstub: Clean up command line parsing routine 2020-02-23 21:57:15 +01:00
string.c efi/libstub: Clean up command line parsing routine 2020-02-23 21:57:15 +01:00
tpm.c efi/libstub: Rename efi_call_early/_runtime macros to be more intuitive 2019-12-25 10:49:25 +01:00
x86-stub.c efi/libstub: Take noinitrd cmdline argument into account for devpath initrd 2020-02-23 21:59:42 +01:00