[PATCH 2/2] ACPI: processor: Prevent unsafe module unloading
From: Christian Loehle
Date: Tue Nov 17 2026 - 04:16:35 EST
Unloading processor.ko unregisters its cpufreq notifier without removing
the performance and thermal QoS requests from existing policies. Active
limits remain applied. If a policy is destroyed while the notifier is
absent, its freed constraints remain referenced by those requests.
After processor is reloaded, removing a replacement policy accesses
freed
memory.
Module unload can also free CPPC descriptors while cppc_cpufreq still
uses them: CPPC accessor symbols are built in and do not themselves pin
processor.ko.
Remove module_exit() and the CPU-hotplug state used only by it. Keep
ACPI_PROCESSOR tristate so processor.ko and its load-time parameters
remain available.
Fixes: 4f2f757351df ("CPPC: Probe for CPPC tables for each ACPI Processor object")
Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
Link: https://sashiko.dev/#/patchset/20260807111303.1062391-1-christian.loehle%40arm.com
Signed-off-by: Christian Loehle <christian.loehle@xxxxxxx>
---
drivers/acpi/processor_driver.c | 25 -------------------------
1 file changed, 25 deletions(-)
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 59418b2e09b6..38783689a319 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -234,12 +234,6 @@ static struct notifier_block acpi_processor_notifier_block = {
void __weak acpi_processor_init_invariance_cppc(void)
{ }
-/*
- * We keep the driver loaded even when ACPI is not running.
- * This is needed for the powernow-k8 driver, that works even without
- * ACPI, but needs symbols from this driver
- */
-static enum cpuhp_state hp_online;
static int __init acpi_processor_driver_init(void)
{
int result = 0;
@@ -264,7 +258,6 @@ static int __init acpi_processor_driver_init(void)
acpi_soft_cpu_online, NULL);
if (result < 0)
goto err;
- hp_online = result;
cpuhp_setup_state_nocalls(CPUHP_ACPI_CPUDRV_DEAD, "acpi/cpu-drv:dead",
NULL, acpi_soft_cpu_dead);
@@ -295,24 +288,6 @@ static int __init acpi_processor_driver_init(void)
return result;
}
-static void __exit acpi_processor_driver_exit(void)
-{
- if (acpi_disabled)
- return;
-
- if (acpi_processor_cpufreq_init) {
- cpufreq_unregister_notifier(&acpi_processor_notifier_block,
- CPUFREQ_POLICY_NOTIFIER);
- acpi_processor_cpufreq_init = false;
- }
-
- cpuhp_remove_state_nocalls(hp_online);
- cpuhp_remove_state_nocalls(CPUHP_ACPI_CPUDRV_DEAD);
- driver_unregister(&acpi_processor_driver);
- acpi_processor_unregister_idle_driver();
-}
-
module_init(acpi_processor_driver_init);
-module_exit(acpi_processor_driver_exit);
MODULE_ALIAS("processor");
--
2.34.1