efi: Drop minimum EFI version check at boot
authorArd Biesheuvel <ardb@kernel.org>
Fri, 3 Feb 2023 16:39:38 +0000 (17:39 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Fri, 3 Feb 2023 17:01:07 +0000 (18:01 +0100)
We currently pass a minimum major version to the generic EFI helper that
checks the system table magic and version, and refuse to boot if the
value is lower.

The motivation for this check is unknown, and even the code that uses
major version 2 as the minimum (ARM, arm64 and RISC-V) should make it
past this check without problems, and boot to a point where we have
access to a console or some other means to inform the user that the
firmware's major revision number made us unhappy. (Revision 2.0 of the
UEFI specification was released in January 2006, whereas ARM, arm64 and
RISC-V support where added in 2009, 2013 and 2017, respectively, so
checking for major version 2 or higher is completely arbitrary)

So just drop the check.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
arch/ia64/kernel/efi.c
arch/x86/platform/efi/efi.c
drivers/firmware/efi/efi-init.c
drivers/firmware/efi/efi.c
include/linux/efi.h

index 31149e41f9be0913f1911817fc963498005b3559..21dfa4aa35bb1e8559c9d6b3051f9d520b87c6ec 100644 (file)
@@ -525,7 +525,7 @@ efi_init (void)
         */
        if (efi_systab == NULL)
                panic("Whoa! Can't find EFI system table.\n");
-       if (efi_systab_check_header(&efi_systab->hdr, 1))
+       if (efi_systab_check_header(&efi_systab->hdr))
                panic("Whoa! EFI system table signature incorrect\n");
 
        efi_systab_report_header(&efi_systab->hdr, efi_systab->fw_vendor);
index 55d9caf66401a445fdd27e18e49010988e6a3337..f3f2d87cce1b9631d35105884a2c2767e918d790 100644 (file)
@@ -380,7 +380,7 @@ static int __init efi_systab_init(unsigned long phys)
                return -ENOMEM;
        }
 
-       ret = efi_systab_check_header(hdr, 1);
+       ret = efi_systab_check_header(hdr);
        if (ret) {
                early_memunmap(p, size);
                return ret;
index 1639159493e3e9992a5178e492fdd628da2b9a9b..2c16080e1f71907c6f7b03434c4cd2ac47a6ea62 100644 (file)
@@ -92,7 +92,7 @@ static int __init uefi_init(u64 efi_system_table)
        if (IS_ENABLED(CONFIG_64BIT))
                set_bit(EFI_64BIT, &efi.flags);
 
-       retval = efi_systab_check_header(&systab->hdr, 2);
+       retval = efi_systab_check_header(&systab->hdr);
        if (retval)
                goto out;
 
index 52146f95d58e763d90801d44ded1ef86afcdc57d..53fa4d14da659d0efc5c08bfdf7442d7da4f9e54 100644 (file)
@@ -759,20 +759,13 @@ int __init efi_config_parse_tables(const efi_config_table_t *config_tables,
        return 0;
 }
 
-int __init efi_systab_check_header(const efi_table_hdr_t *systab_hdr,
-                                  int min_major_version)
+int __init efi_systab_check_header(const efi_table_hdr_t *systab_hdr)
 {
        if (systab_hdr->signature != EFI_SYSTEM_TABLE_SIGNATURE) {
                pr_err("System table signature incorrect!\n");
                return -EINVAL;
        }
 
-       if ((systab_hdr->revision >> 16) < min_major_version)
-               pr_err("Warning: System table version %d.%02d, expected %d.00 or greater!\n",
-                      systab_hdr->revision >> 16,
-                      systab_hdr->revision & 0xffff,
-                      min_major_version);
-
        return 0;
 }
 
index 507390dda8b9c2f2701748bb61ebf567ff1b0edf..9d455d502ac92b653176b21cc5068a2a2115e36a 100644 (file)
@@ -721,8 +721,7 @@ static inline void efi_esrt_init(void) { }
 extern int efi_config_parse_tables(const efi_config_table_t *config_tables,
                                   int count,
                                   const efi_config_table_type_t *arch_tables);
-extern int efi_systab_check_header(const efi_table_hdr_t *systab_hdr,
-                                  int min_major_version);
+extern int efi_systab_check_header(const efi_table_hdr_t *systab_hdr);
 extern void efi_systab_report_header(const efi_table_hdr_t *systab_hdr,
                                     unsigned long fw_vendor);
 extern u64 efi_get_iobase (void);