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@xxxxxxxxxx> Cc: Matthew Garrett <mjg59@xxxxxxxxxx> Cc: Daniel Kiper <daniel.kiper@xxxxxxxxxx> Cc: Ilias Apalodimas <ilias.apalodimas@xxxxxxxxxx> Cc: "Xu, Min M" <min.m.xu@xxxxxxxxx> 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(-) -- 2.35.1