2016-04-05 19:28:47 +00:00
|
|
|
From d24a5cf53175a3498b9c67a97ca6ad5604d0a678 Mon Sep 17 00:00:00 2001
|
2016-03-04 18:32:29 +00:00
|
|
|
From: Matthew Garrett <mjg59@coreos.com>
|
|
|
|
Date: Thu, 16 Jul 2015 15:22:34 -0700
|
2016-04-05 19:28:47 +00:00
|
|
|
Subject: [PATCH 74/88] Measure kernel + initrd
|
2016-03-04 18:32:29 +00:00
|
|
|
|
|
|
|
Measure the kernel and initrd when loaded on UEFI systems
|
|
|
|
---
|
|
|
|
grub-core/loader/i386/efi/linux.c | 4 ++++
|
|
|
|
1 file changed, 4 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/grub-core/loader/i386/efi/linux.c b/grub-core/loader/i386/efi/linux.c
|
|
|
|
index 7ccf32d..4ee45e9 100644
|
|
|
|
--- a/grub-core/loader/i386/efi/linux.c
|
|
|
|
+++ b/grub-core/loader/i386/efi/linux.c
|
|
|
|
@@ -27,6 +27,7 @@
|
|
|
|
#include <grub/lib/cmdline.h>
|
|
|
|
#include <grub/efi/efi.h>
|
|
|
|
#include <grub/efi/linux.h>
|
|
|
|
+#include <grub/tpm.h>
|
|
|
|
|
|
|
|
GRUB_MOD_LICENSE ("GPLv3+");
|
|
|
|
|
|
|
|
@@ -129,6 +130,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
|
|
|
argv[i]);
|
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
+ grub_tpm_measure (ptr, cursize, GRUB_INITRD_PCR, "UEFI Linux initrd");
|
|
|
|
ptr += cursize;
|
|
|
|
grub_memset (ptr, 0, ALIGN_UP_OVERHEAD (cursize, 4));
|
|
|
|
ptr += ALIGN_UP_OVERHEAD (cursize, 4);
|
|
|
|
@@ -184,6 +186,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
|
|
|
|
goto fail;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ grub_tpm_measure (kernel, filelen, GRUB_KERNEL_PCR, "UEFI Linux kernel");
|
|
|
|
+
|
|
|
|
if (! grub_linuxefi_secure_validate (kernel, filelen))
|
|
|
|
{
|
|
|
|
grub_error (GRUB_ERR_INVALID_COMMAND, N_("%s has invalid signature"), argv[0]);
|
|
|
|
--
|
2016-04-05 19:28:47 +00:00
|
|
|
2.5.5
|
2016-03-04 18:32:29 +00:00
|
|
|
|