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 securelevel is set, 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 securelevel is set.
Signed-off-by: Linn Crosetto <linn@hpe.com>
Orabug:
25058372
CVE: CVE-2016-3699
Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
Reviewed-by: Guru Anbalagane <guru.anbalagane@oracle.com>
/* Allocate bigger log buffer */
setup_log_buf(1);
+#ifdef CONFIG_EFI_SECURE_BOOT_SECURELEVEL
+ if (boot_params.secure_boot) {
+ set_bit(EFI_SECURE_BOOT, &efi.flags);
+ set_securelevel(1);
+ pr_info("Secure boot enabled\n");
+ }
+#endif
+
reserve_initrd();
#if defined(CONFIG_ACPI) && defined(CONFIG_BLK_DEV_INITRD)
io_delay_init();
-#ifdef CONFIG_EFI_SECURE_BOOT_SECURELEVEL
- if (boot_params.secure_boot) {
- set_bit(EFI_SECURE_BOOT, &efi.flags);
- set_securelevel(1);
- pr_info("Secure boot enabled\n");
- }
-#endif
-
/*
* Parse the ACPI tables for possible boot-time SMP configuration.
*/
if (table_nr == 0)
return;
+ if (get_securelevel() > 0) {
+ pr_notice(PREFIX
+ "securelevel enabled, ignoring table override\n");
+ return;
+}
+
acpi_tables_addr =
memblock_find_in_range(0, max_low_pfn_mapped << PAGE_SHIFT,
all_tables_size, PAGE_SIZE);