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 <km@mkukri.xyz>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Javier Martinez Canillas authored and Daniel Kiper committed 2021-03-02 15:54:15 +01:00
1 parent 8f73052885
commit 3e8e4c0549
2 files changed
+7 -1

No files matched your search

+5
View File
@@ -4074,6 +4074,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 (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 @option{--no-ebda} option is used, the new tables will be known only to
GRUB, but may be used by GRUB's EFI emulation. 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 @end deffn
+2 -1
View File
@@ -27,6 +27,7 @@
#include <grub/mm.h> #include <grub/mm.h>
#include <grub/memory.h> #include <grub/memory.h>
#include <grub/i18n.h> #include <grub/i18n.h>
#include <grub/lockdown.h>
#ifdef GRUB_MACHINE_EFI #ifdef GRUB_MACHINE_EFI
#include <grub/efi/efi.h> #include <grub/efi/efi.h>
@@ -775,7 +776,7 @@ static grub_extcmd_t cmd;
GRUB_MOD_INIT(acpi) GRUB_MOD_INIT(acpi)
{ {
cmd = grub_register_extcmd ("acpi", grub_cmd_acpi, 0, cmd = grub_register_extcmd_lockdown ("acpi", grub_cmd_acpi, 0,
N_("[-1|-2] [--exclude=TABLE1,TABLE2|" N_("[-1|-2] [--exclude=TABLE1,TABLE2|"
"--load-only=TABLE1,TABLE2] FILE1" "--load-only=TABLE1,TABLE2] FILE1"
" [FILE2] [...]"), " [FILE2] [...]"),