From: Éric Piel Date: Mon, 4 Feb 2008 23:04:50 +0000 (+0100) Subject: ACPI: Taint kernel on ACPI table override (format corrected) X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6ed31e92e94830c138fbd470486383380710069a;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git ACPI: Taint kernel on ACPI table override (format corrected) When an ACPI table is overridden (for now this can happen only for DSDT) display a big warning and taint the kernel with flag A. Signed-off-by: Eric Piel Signed-off-by: Len Brown --- diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 131936e7ff17..bbd8360bfb23 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -392,6 +392,13 @@ acpi_os_table_override(struct acpi_table_header * existing_table, *new_table = initrd_table; } #endif + if (*new_table != NULL) { + printk(KERN_WARNING PREFIX "Override [%4.4s-%8.8s], " + "this is unsafe: tainting kernel\n", + existing_table->signature, + existing_table->oem_table_id); + add_taint(TAINT_OVERRIDDEN_ACPI_TABLE); + } return AE_OK; } diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 18222f267bc4..9e01f376840a 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -243,6 +243,7 @@ extern enum system_states { #define TAINT_BAD_PAGE (1<<5) #define TAINT_USER (1<<6) #define TAINT_DIE (1<<7) +#define TAINT_OVERRIDDEN_ACPI_TABLE (1<<8) extern void dump_stack(void) __cold; diff --git a/kernel/panic.c b/kernel/panic.c index d9e90cfe3298..24af9f8bac99 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -161,7 +161,7 @@ const char *print_tainted(void) { static char buf[20]; if (tainted) { - snprintf(buf, sizeof(buf), "Tainted: %c%c%c%c%c%c%c%c", + snprintf(buf, sizeof(buf), "Tainted: %c%c%c%c%c%c%c%c%c", tainted & TAINT_PROPRIETARY_MODULE ? 'P' : 'G', tainted & TAINT_FORCED_MODULE ? 'F' : ' ', tainted & TAINT_UNSAFE_SMP ? 'S' : ' ', @@ -169,7 +169,8 @@ const char *print_tainted(void) tainted & TAINT_MACHINE_CHECK ? 'M' : ' ', tainted & TAINT_BAD_PAGE ? 'B' : ' ', tainted & TAINT_USER ? 'U' : ' ', - tainted & TAINT_DIE ? 'D' : ' '); + tainted & TAINT_DIE ? 'D' : ' ', + tainted & TAINT_OVERRIDDEN_ACPI_TABLE ? 'A' : ' '); } else snprintf(buf, sizeof(buf), "Not tainted");