Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

acpi: Disable ACPI table override if the kernel is locked down

>From the kernel documentation (initrd_table_override.txt):

If the ACPI_INITRD_TABLE_OVERRIDE compile option is true, it is possible
to override nearly any ACPI table provided by the BIOS with an
instrumented, modified one.

When lockdown is enabled, the kernel should disallow any unauthenticated
changes to kernel space. ACPI tables contain code invoked by the kernel,
so do not allow ACPI tables to be overridden if the kernel is locked down.

Signed-off-by: Linn Crosetto <lcrosetto@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Matthew Garrett <mjg59@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
cc: linux-acpi@vger.kernel.org
Signed-off-by: James Morris <jmorris@namei.org>

authored by

Linn Crosetto and committed by
James Morris
6ea0e815 41fa1ee9

+6
+6
drivers/acpi/tables.c
··· 20 20 #include <linux/memblock.h> 21 21 #include <linux/earlycpio.h> 22 22 #include <linux/initrd.h> 23 + #include <linux/security.h> 23 24 #include "internal.h" 24 25 25 26 #ifdef CONFIG_ACPI_CUSTOM_DSDT ··· 577 576 } 578 577 if (table_nr == 0) 579 578 return; 579 + 580 + if (security_locked_down(LOCKDOWN_ACPI_TABLES)) { 581 + pr_notice("kernel is locked down, ignoring table override\n"); 582 + return; 583 + } 580 584 581 585 acpi_tables_addr = 582 586 memblock_find_in_range(0, ACPI_TABLE_UPGRADE_MAX_PHYS,