* [PATCH v1] ACPI: bus: Ensure that notify handlers are not running after removal
@ 2023-04-14 14:00 Rafael J. Wysocki
0 siblings, 0 replies; only message in thread
From: Rafael J. Wysocki @ 2023-04-14 14:00 UTC (permalink / raw)
To: Linux ACPI; +Cc: LKML, Hans de Goede
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Currently, acpi_device_remove_notify_handler() may return while the
notify handler being removed is still running which may allow the
module holding that handler to be torn down prematurely.
Address this issue by making acpi_device_remove_notify_handler() wait
for the handling of all the ACPI events in progress to complete before
returning.
Fixes: 5894b0c46e49 ("ACPI / scan: Move bus operations and notification routines to bus.c")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/acpi/bus.c | 1 +
1 file changed, 1 insertion(+)
Index: linux-pm/drivers/acpi/bus.c
===================================================================
--- linux-pm.orig/drivers/acpi/bus.c
+++ linux-pm/drivers/acpi/bus.c
@@ -589,6 +589,7 @@ static void acpi_device_remove_notify_ha
acpi_remove_notify_handler(device->handle, type,
acpi_notify_device);
}
+ acpi_os_wait_events_complete();
}
/* Handle events targeting \_SB device (at present only graceful shutdown) */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-04-14 14:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-14 14:00 [PATCH v1] ACPI: bus: Ensure that notify handlers are not running after removal Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox