Skip to content

Commit 234fa51

Browse files
committed
efi: Drop minimum EFI version check at boot
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 <[email protected]>
1 parent ace013a commit 234fa51

File tree

5 files changed

+5
-13
lines changed

5 files changed

+5
-13
lines changed

arch/ia64/kernel/efi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ efi_init (void)
525525
*/
526526
if (efi_systab == NULL)
527527
panic("Whoa! Can't find EFI system table.\n");
528-
if (efi_systab_check_header(&efi_systab->hdr, 1))
528+
if (efi_systab_check_header(&efi_systab->hdr))
529529
panic("Whoa! EFI system table signature incorrect\n");
530530

531531
efi_systab_report_header(&efi_systab->hdr, efi_systab->fw_vendor);

arch/x86/platform/efi/efi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ static int __init efi_systab_init(unsigned long phys)
380380
return -ENOMEM;
381381
}
382382

383-
ret = efi_systab_check_header(hdr, 1);
383+
ret = efi_systab_check_header(hdr);
384384
if (ret) {
385385
early_memunmap(p, size);
386386
return ret;

drivers/firmware/efi/efi-init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static int __init uefi_init(u64 efi_system_table)
9292
if (IS_ENABLED(CONFIG_64BIT))
9393
set_bit(EFI_64BIT, &efi.flags);
9494

95-
retval = efi_systab_check_header(&systab->hdr, 2);
95+
retval = efi_systab_check_header(&systab->hdr);
9696
if (retval)
9797
goto out;
9898

drivers/firmware/efi/efi.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -759,20 +759,13 @@ int __init efi_config_parse_tables(const efi_config_table_t *config_tables,
759759
return 0;
760760
}
761761

762-
int __init efi_systab_check_header(const efi_table_hdr_t *systab_hdr,
763-
int min_major_version)
762+
int __init efi_systab_check_header(const efi_table_hdr_t *systab_hdr)
764763
{
765764
if (systab_hdr->signature != EFI_SYSTEM_TABLE_SIGNATURE) {
766765
pr_err("System table signature incorrect!\n");
767766
return -EINVAL;
768767
}
769768

770-
if ((systab_hdr->revision >> 16) < min_major_version)
771-
pr_err("Warning: System table version %d.%02d, expected %d.00 or greater!\n",
772-
systab_hdr->revision >> 16,
773-
systab_hdr->revision & 0xffff,
774-
min_major_version);
775-
776769
return 0;
777770
}
778771

include/linux/efi.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,8 +721,7 @@ static inline void efi_esrt_init(void) { }
721721
extern int efi_config_parse_tables(const efi_config_table_t *config_tables,
722722
int count,
723723
const efi_config_table_type_t *arch_tables);
724-
extern int efi_systab_check_header(const efi_table_hdr_t *systab_hdr,
725-
int min_major_version);
724+
extern int efi_systab_check_header(const efi_table_hdr_t *systab_hdr);
726725
extern void efi_systab_report_header(const efi_table_hdr_t *systab_hdr,
727726
unsigned long fw_vendor);
728727
extern u64 efi_get_iobase (void);

0 commit comments

Comments
 (0)