diff options
Diffstat (limited to 'debian/patches-rt/x86-ima-Check-EFI_RUNTIME_SERVICES-before-using.patch')
-rw-r--r-- | debian/patches-rt/x86-ima-Check-EFI_RUNTIME_SERVICES-before-using.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/debian/patches-rt/x86-ima-Check-EFI_RUNTIME_SERVICES-before-using.patch b/debian/patches-rt/x86-ima-Check-EFI_RUNTIME_SERVICES-before-using.patch new file mode 100644 index 000000000..350fb178d --- /dev/null +++ b/debian/patches-rt/x86-ima-Check-EFI_RUNTIME_SERVICES-before-using.patch @@ -0,0 +1,32 @@ +From: Scott Wood <swood@redhat.com> +Date: Tue, 23 Apr 2019 17:48:07 -0500 +Subject: [PATCH] x86/ima: Check EFI_RUNTIME_SERVICES before using +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.10-rt7.tar.xz + +Checking efi_enabled(EFI_BOOT) is not sufficient to ensure that +EFI runtime services are available, e.g. if efi=noruntime is used. + +Without this, I get an oops on a PREEMPT_RT kernel where efi=noruntime is +the default. + +Fixes: 399574c64eaf94e8 ("x86/ima: retry detecting secure boot mode") +Signed-off-by: Scott Wood <swood@redhat.com> +Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +--- + arch/x86/kernel/ima_arch.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/arch/x86/kernel/ima_arch.c ++++ b/arch/x86/kernel/ima_arch.c +@@ -17,6 +17,11 @@ static enum efi_secureboot_mode get_sb_m + + size = sizeof(secboot); + ++ if (!efi_enabled(EFI_RUNTIME_SERVICES)) { ++ pr_info("ima: secureboot mode unknown, no efi\n"); ++ return efi_secureboot_mode_unknown; ++ } ++ + /* Get variable contents into buffer */ + status = efi.get_variable(efi_SecureBoot_name, &efi_variable_guid, + NULL, &size, &secboot); |