From: Kyle McMartin Date: Wed, 5 Apr 2017 16:40:30 +0000 (+0100) Subject: Add a sysrq option to exit secure boot mode X-Git-Tag: archive/raspbian/4.15.4-1+rpi1~55 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=aa5ba74dc77a4fbce442ee1ab0edcc5dd7b7a22b;p=linux.git Add a sysrq option to exit secure boot mode Make sysrq+x exit secure boot mode on x86_64, thereby allowing the running kernel image to be modified. This lifts the lockdown. Signed-off-by: Kyle McMartin Signed-off-by: David Howells [bwh: For 4.12, adjust context] Gbp-Pq: Topic features/all/lockdown Gbp-Pq: Name 0043-Add-a-sysrq-option-to-exit-secure-boot-mode.patch --- diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 6bc8db6985f..d236c94f529 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1899,6 +1899,16 @@ config EFI_SECURE_BOOT_LOCK_DOWN image. Say Y here to automatically lock down the kernel when a system boots with UEFI Secure Boot enabled. +config EFI_ALLOW_SECURE_BOOT_EXIT + def_bool n + depends on EFI_SECURE_BOOT_LOCK_DOWN && MAGIC_SYSRQ + select ALLOW_LOCKDOWN_LIFT + prompt "Allow secure boot mode to be exited with SysRq+x on a keyboard" + ---help--- + Allow secure boot mode to be exited and the kernel lockdown lifted by + typing SysRq+x on a keyboard attached to the system (not permitted + through procfs). + config SECCOMP def_bool y prompt "Enable seccomp to safely compute untrusted bytecode" diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index e6a2155651c..a8230bed45d 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -72,6 +72,11 @@ #include #include +#include +#include +#include +#include + #include #include