diff options
author | Scott Wood <swood@redhat.com> | 2019-04-24 01:48:07 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-09 10:16:14 +0300 |
commit | c59e2a64128e30a16394b2fa09b7470c2e2f6f68 (patch) | |
tree | c3071b9e4dc1480e238b1ea1aa4e1a188badfdcd /arch | |
parent | bd411a6249654e42ff5d5372e84c2db4adeebddb (diff) | |
download | linux-c59e2a64128e30a16394b2fa09b7470c2e2f6f68.tar.xz |
x86/ima: Check EFI_RUNTIME_SERVICES before using
commit 558b523d46289f111d53d7c42211069063be5985 upstream.
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")
Cc: stable@vger.kernel.org (linux-5.0)
Signed-off-by: Scott Wood <swood@redhat.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/ima_arch.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kernel/ima_arch.c b/arch/x86/kernel/ima_arch.c index e47cd9390ab4..2a2e87717bad 100644 --- 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_mode(void) 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); |