[RFC PATCH 3/8] ACPICA: Tables: Fix an issue the dynamic table loading contains code with MTX_TABLES released

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Panic can be seen when OS runs _PDC from different CPUs to dynamically
"Load" the tables. And this is because acpi_tb_validate_table() is an
early stage only API and cannot be deployed to the racing environment.
While here we want the table to be transitioned into the "VALIDATED"
state before being transitioned into "LOADED" state, so
acpi_tb_validate_table_by_index() is actually the proper API that should be
invoked here and it properly locks the table descriptor with MTX_TABLES
mutex. Lv Zheng.

Link: https://bugs.acpica.org/show_bug.cgi?id=1254
Signed-off-by: Lv Zheng <lv.zheng@xxxxxxxxx>
---
 drivers/acpi/acpica/exconfig.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c
index 98102af..3418c90 100644
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -493,10 +493,12 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc,
 	/*
 	 * Note: Now table is "INSTALLED", it must be validated before
 	 * loading.
+	 * As Table pointer has been installed, no code from here will still be
+	 * using the original pointer. Furthermore, the table handler actually
+	 * wants a validation result of the table. So this pointer is refilled
+	 * by the returning value of acpi_tb_validate_table_by_index().
 	 */
-	status =
-	    acpi_tb_validate_table(&acpi_gbl_root_table_list.
-				   tables[table_index]);
+	status = acpi_tb_validate_table_by_index(table_index, &table);
 	if (ACPI_FAILURE(status)) {
 		return_ACPI_STATUS(status);
 	}
-- 
1.7.10

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux