x86/ima: Use EFI GetVariable only when available
authorArd Biesheuvel <ardb@kernel.org>
Thu, 23 Jan 2020 12:09:35 +0000 (13:09 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Sun, 23 Feb 2020 20:59:42 +0000 (21:59 +0100)
Replace the EFI runtime services check with one that tells us whether
EFI GetVariable() is implemented by the firmware.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
arch/x86/kernel/ima_arch.c

index 4d4f5d9faac314ad5fe5c21a05e72c873ec42d65..cb6ed616a543290ec8f7f3efaf4334c39f2b7b90 100644 (file)
@@ -19,7 +19,7 @@ static enum efi_secureboot_mode get_sb_mode(void)
 
        size = sizeof(secboot);
 
-       if (!efi_enabled(EFI_RUNTIME_SERVICES)) {
+       if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) {
                pr_info("ima: secureboot mode unknown, no efi\n");
                return efi_secureboot_mode_unknown;
        }