From bfd27940001650449c77d3e17db60b07174591fe Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Mon, 21 Nov 2016 23:55:56 +0000 Subject: [PATCH] UBUNTU: SAUCE: (efi-lockdown) 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: David Howells (cherry picked from commit 67c54947d00f8bd3124982560c33e66030d58ff7 git://git.kernel.org/pub/scm/linux/kernel/git/jwboyer/fedora.git) Signed-off-by: Seth Forshee --- arch/x86/Kconfig | 10 ++++++++++ arch/x86/kernel/setup.c | 31 +++++++++++++++++++++++++++++++ drivers/input/misc/uinput.c | 1 + drivers/tty/sysrq.c | 19 +++++++++++++------ include/linux/input.h | 5 +++++ include/linux/sysrq.h | 8 +++++++- kernel/debug/kdb/kdb_main.c | 2 +- 7 files changed, 68 insertions(+), 8 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 1856d37120a5..3fdb4daa8146 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1848,6 +1848,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 d0128aef43ce..d7e8b983aa72 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -71,6 +71,11 @@ #include #include +#include +#include +#include +#include + #include #include