mbox series

[v2,0/2] efi: measure kernel command line

Message ID 20220920122746.3553306-1-ardb@kernel.org
Headers show
Series efi: measure kernel command line | expand

Message

Ard Biesheuvel Sept. 20, 2022, 12:27 p.m. UTC
Measuring the kernel command line (or more generically, image load
options in EFI parlance) is not covered by the TCG spec, which only
reasons about images started as boot options.

Let's work around this oversight by measuring the kernel command line
from the EFI stub itself. Since load options is essentially just a
sequence of bytes, which happens to be interpreted as UTF-16 and
subsequently converted into ASCII before being used as the kernel
command line, let's just measure the whole thing and not the resulting
ASCII string.

Cc: Peter Jones <pjones@redhat.com>
Cc: Matthew Garrett <mjg59@google.com>
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: "Xu, Min M" <min.m.xu@intel.com>

Ilias Apalodimas (2):
  efi/libstub: refactor the initrd measuring functions
  efi/libstub: measure EFI LoadOptions

 drivers/firmware/efi/libstub/efi-stub-helper.c | 130 +++++++++++++-------
 drivers/firmware/efi/libstub/efistub.h         |   1 +
 2 files changed, 88 insertions(+), 43 deletions(-)