Skip to content

Commit

Permalink
- efi: Lock down the kernel if booted in secure boot mode
Browse files Browse the repository at this point in the history
  (jsc#SLE-9870).
- Update config files. (jsc#SLE-9870)

suse-commit: 7f8d57d68385ceda2c734678d2ad92b03c3a8a18
  • Loading branch information
joeyli authored and mkubecek committed Nov 27, 2019
1 parent d055a21 commit d3416b9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/x86/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
#include <linux/jiffies.h>
#include <linux/mem_encrypt.h>
#include <linux/sizes.h>
#include <linux/security.h>

#include <linux/usb/xhci-dbgp.h>
#include <video/edid.h>
Expand Down Expand Up @@ -1027,6 +1028,13 @@ void __init setup_arch(char **cmdline_p)
if (efi_enabled(EFI_BOOT))
efi_init();

efi_set_secure_boot(boot_params.secure_boot);

#ifdef CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT
if (efi_enabled(EFI_SECURE_BOOT))
security_lock_kernel_down("EFI Secure Boot mode", LOCKDOWN_CONFIDENTIALITY_MAX);
#endif

dmi_setup();

/*
Expand Down
13 changes: 13 additions & 0 deletions security/lockdown/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@ config SECURITY_LOCKDOWN_LSM_EARLY
subsystem is fully initialised. If enabled, lockdown will
unconditionally be called before any other LSMs.

config LOCK_DOWN_IN_EFI_SECURE_BOOT
bool "Lock down the kernel in EFI Secure Boot mode"
default n
depends on EFI && SECURITY_LOCKDOWN_LSM_EARLY
help
UEFI Secure Boot provides a mechanism for ensuring that the firmware
will only load signed bootloaders and kernels. Secure boot mode may
be determined from EFI variables provided by the system firmware if
not indicated by the boot parameters.

Enabling this option results in kernel lockdown being triggered if
EFI Secure Boot is set.

choice
prompt "Kernel default lockdown mode"
default LOCK_DOWN_KERNEL_FORCE_NONE
Expand Down

0 comments on commit d3416b9

Please sign in to comment.