integrity: Check properly whether EFI GetVariable() is available
authorArd Biesheuvel <ardb@kernel.org>
Sun, 16 Feb 2020 18:46:25 +0000 (19:46 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Sun, 23 Feb 2020 20:59:42 +0000 (21:59 +0100)
Testing the value of the efi.get_variable function pointer is not
the right way to establish whether the platform supports EFI
variables at runtime. Instead, use the newly added granular check
that can test for the presence of each EFI runtime service
individually.

Acked-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
security/integrity/platform_certs/load_uefi.c

index 111898a..e2fe1bd 100644 (file)
@@ -76,7 +76,7 @@ static int __init load_uefi_certs(void)
        unsigned long dbsize = 0, dbxsize = 0, moksize = 0;
        int rc = 0;
 
-       if (!efi.get_variable)
+       if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
                return false;
 
        /* Get db, MokListRT, and dbx.  They might not exist, so it isn't