From: Javier Martinez Canillas Date: Mon, 28 Sep 2020 18:08:41 +0000 (+0200) Subject: acpi: Don't register the acpi command when locked down X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=b62501e6d869aa0968a17c8cb2379bde475dab20;p=grub2.git acpi: Don't register the acpi command when locked down The command is not allowed when lockdown is enforced. Otherwise an attacker can instruct the GRUB to load an SSDT table to overwrite the kernel lockdown configuration and later load and execute unsigned code. Fixes: CVE-2020-14372 Reported-by: Máté Kukri Signed-off-by: Javier Martinez Canillas Reviewed-by: Daniel Kiper Patch-Name: 2021-02-security/006-acpi-Don-t-register-the-acpi-command-when-locked-down.patch --- diff --git a/docs/grub.texi b/docs/grub.texi index 30ffe720f..9d9af3a80 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -4005,6 +4005,11 @@ Normally, this command will replace the Root System Description Pointer (RSDP) in the Extended BIOS Data Area to point to the new tables. If the @option{--no-ebda} option is used, the new tables will be known only to GRUB, but may be used by GRUB's EFI emulation. + +Note: The command is not allowed when lockdown is enforced (@pxref{Lockdown}). + Otherwise an attacker can instruct the GRUB to load an SSDT table to + overwrite the kernel lockdown configuration and later load and execute + unsigned code. @end deffn diff --git a/grub-core/commands/acpi.c b/grub-core/commands/acpi.c index 5a1499aa0..1215f2a62 100644 --- a/grub-core/commands/acpi.c +++ b/grub-core/commands/acpi.c @@ -27,6 +27,7 @@ #include #include #include +#include #ifdef GRUB_MACHINE_EFI #include @@ -775,13 +776,13 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT(acpi) { - cmd = grub_register_extcmd ("acpi", grub_cmd_acpi, 0, - N_("[-1|-2] [--exclude=TABLE1,TABLE2|" - "--load-only=TABLE1,TABLE2] FILE1" - " [FILE2] [...]"), - N_("Load host ACPI tables and tables " - "specified by arguments."), - options); + cmd = grub_register_extcmd_lockdown ("acpi", grub_cmd_acpi, 0, + N_("[-1|-2] [--exclude=TABLE1,TABLE2|" + "--load-only=TABLE1,TABLE2] FILE1" + " [FILE2] [...]"), + N_("Load host ACPI tables and tables " + "specified by arguments."), + options); } GRUB_MOD_FINI(acpi)