]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ACPI: bus: Ensure that notify handlers are not running after removal
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 14 Apr 2023 14:00:48 +0000 (16:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:11:07 +0000 (23:11 +0900)
commit156539cbb13bd38458698f67a75257e1b2881ed2
treecc62c41c39a7f81e1f1fdd5269d0fbb6b8000c16
parentf0cb827199ec1802ead1ea78e35c869db05ec454
ACPI: bus: Ensure that notify handlers are not running after removal

[ Upstream commit faae443738c6f0dac9b0d3d11d108f6911a989a9 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/acpi/bus.c