[PATCH v2 37/42] ACPICA: tables: Fix global table read missing mutex

From: Maciej Wieczor-Retman

Date: Fri Nov 20 2026 - 12:29:16 EST


Reading AcpiGbl_RootTableList.Tables[].OwnerId without holding an
appropriate mutex can lead to races if anything modified the table after
the read.

Use a helper specifically dedicated to reading the OwnerId.

Link: https://github.com/acpica/acpica/commit/ef7cf3f3def2
Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@xxxxxxxxx>
---
drivers/acpi/acpica/tbdata.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c
index 1cf0a46b3539..94ac355daae7 100644
--- a/drivers/acpi/acpica/tbdata.c
+++ b/drivers/acpi/acpica/tbdata.c
@@ -1059,6 +1059,7 @@ acpi_status acpi_tb_unload_table(u32 table_index)
{
acpi_status status = AE_OK;
struct acpi_table_header *table;
+ acpi_owner_id ACPI_UNUSED_VAR owner_id;

ACPI_FUNCTION_TRACE(tb_unload_table);

@@ -1074,8 +1075,8 @@ acpi_status acpi_tb_unload_table(u32 table_index)
* If any matching GPE is currently dispatching, AE_ABORT_METHOD is
* returned and the unload cannot proceed.
*/
- status = acpi_ev_clear_gpe_dispatch_by_owner(
- acpi_gbl_root_table_list.tables[table_index].owner_id);
+ acpi_tb_get_owner_id(table_index, &owner_id);
+ status = acpi_ev_clear_gpe_dispatch_by_owner(owner_id);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
--
2.56.0