UEFI machines can be booted in Secure Boot mode.  Add a EFI_SECURE_BOOT bit
for use with efi_enabled.

Signed-off-by: Josh Boyer <jwbo...@fedoraproject.org>
---
 arch/x86/kernel/setup.c | 2 ++
 include/linux/efi.h     | 1 +
 2 files changed, 3 insertions(+)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index d40e961753c9..b93183336674 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1162,7 +1162,9 @@ void __init setup_arch(char **cmdline_p)
 
 #ifdef CONFIG_EFI_SECURE_BOOT_SIG_ENFORCE
        if (boot_params.secure_boot) {
+               set_bit(EFI_SECURE_BOOT, &efi.flags);
                enforce_signed_modules();
+               pr_info("Secure boot enabled\n");
        }
 #endif
 
diff --git a/include/linux/efi.h b/include/linux/efi.h
index ce943d5accfd..5af91b58afae 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -1046,6 +1046,7 @@ extern int __init efi_setup_pcdp_console(char *);
 #define EFI_ARCH_1             7       /* First arch-specific bit */
 #define EFI_DBG                        8       /* Print additional debug info 
at runtime */
 #define EFI_NX_PE_DATA         9       /* Can runtime data regions be mapped 
non-executable? */
+#define EFI_SECURE_BOOT                10      /* Are we in Secure Boot mode? 
*/
 
 #ifdef CONFIG_EFI
 /*
-- 
2.9.3
_______________________________________________
kernel mailing list -- kernel@lists.fedoraproject.org
To unsubscribe send an email to kernel-le...@lists.fedoraproject.org

Reply via email to