Skip to content

Commit 1957a85

Browse files
Matthew GarrettJames Morris
authored andcommitted
efi: Restrict efivar_ssdt_load when the kernel is locked down
efivar_ssdt_load allows the kernel to import arbitrary ACPI code from an EFI variable, which gives arbitrary code execution in ring 0. Prevent that when the kernel is locked down. Signed-off-by: Matthew Garrett <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Reviewed-by: Kees Cook <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: [email protected] Signed-off-by: James Morris <[email protected]>
1 parent ccbd54f commit 1957a85

File tree

1 file changed

+6
-0
lines changed
  • drivers/firmware/efi

1 file changed

+6
-0
lines changed

drivers/firmware/efi/efi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <linux/acpi.h>
3131
#include <linux/ucs2_string.h>
3232
#include <linux/memblock.h>
33+
#include <linux/security.h>
3334

3435
#include <asm/early_ioremap.h>
3536

@@ -241,6 +242,11 @@ static void generic_ops_unregister(void)
241242
static char efivar_ssdt[EFIVAR_SSDT_NAME_MAX] __initdata;
242243
static int __init efivar_ssdt_setup(char *str)
243244
{
245+
int ret = security_locked_down(LOCKDOWN_ACPI_TABLES);
246+
247+
if (ret)
248+
return ret;
249+
244250
if (strlen(str) < sizeof(efivar_ssdt))
245251
memcpy(efivar_ssdt, str, strlen(str));
246252
else

0 commit comments

Comments
 (0)