]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
UBUNTU: SAUCE: (efi-lockdown) efi: Sanitize boot_params in efi stub
authorSeth Forshee <seth.forshee@canonical.com>
Thu, 4 May 2017 13:09:04 +0000 (08:09 -0500)
committerSeth Forshee <seth.forshee@canonical.com>
Mon, 29 Jan 2018 13:45:03 +0000 (07:45 -0600)
The efi stub will set the value of boot_params.secure_boot
without first checking whether boot_params has been sanitized. If
they have not, the value of secure_boot will be cleared later
when boot_params is sanitized. This currently happens with grub
as it currently does not clear the sentinel, and thus the kernel
cannot determine the secure boot state.

Since the efi stub is modifying a field in an area subject to
sanitization, it must first sanitize boot_params if needed. Later
sanitization by the decompressor will do nothing as the sentinel
value will have been cleared.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
arch/x86/boot/compressed/eboot.c

index e56dbc67e8378e891fa8aa64192d0875237f4aba..44f9b5228d8b1bd9b00208cefdcabbefb09de4a4 100644 (file)
@@ -14,6 +14,7 @@
 #include <asm/e820/types.h>
 #include <asm/setup.h>
 #include <asm/desc.h>
+#include <asm/bootparam_utils.h>
 
 #include "../string.h"
 #include "eboot.h"
@@ -990,6 +991,8 @@ struct boot_params *efi_main(struct efi_config *c,
        else
                setup_boot_services32(efi_early);
 
+       sanitize_boot_params(boot_params);
+
        /*
         * If the boot loader gave us a value for secure_boot then we use that,
         * otherwise we ask the BIOS.