Re: [PATCH 0/2] ACPI: processor: Restrict unsafe driver removal
From: Rafael J. Wysocki (Intel)
Date: Fri Nov 20 2026 - 09:14:53 EST
On Tue, Nov 17, 2026 at 10:16 AM Christian Loehle
<christian.loehle@xxxxxxx> wrote:
>
> Hi,
> I've had the ACPI CPPC lifetime issues on my list for a while, but I've
> been hesitant to restructure the code again. Looking at other users of
> the same removal paths, I found independent failures outside CPPC too.
> Do manual bind/unbind and processor module unloading need to work, or
> can we disable them for now instead of fixing each affected teardown?
>
> Manual unbind and module unload can tear down state still used by the
> acpi_idle cpuidle driver, processor_thermal and cpufreq. This series
> blocks those two operations.
>
> Patch 1 suppresses manual bind/unbind. A second unbind after a nominal
> rebind dereferences an acpi_idle device freed by the first unbind; QEMU
> with KASAN reproduced the use-after-free. A separate test left a cpufreq
> policy capped at 1.6 GHz after processor cooling was unregistered and
> bind reported success. Manual removal can also free CPPC descriptors
> while cppc_cpufreq, amd_pstate or intel_pstate access them.
>
> Patch 2 removes the processor module's exit function. Its cpufreq
> notifier otherwise leaves QoS requests attached to policies on unload.
> I can also reproduce a use-after-free without CPPC: unload processor,
> destroy the old policy, reload processor, then remove a replacement
> policy. Module unload can also free CPPC state used by cppc_cpufreq.
> Keeping ACPI_PROCESSOR tristate preserves late loading and load-time
> parameters while normal rmmod returns -EBUSY.
>
> Ordinary CPU offline/online does not call the processor driver's remove
> callback. Physical CPU ejection does, and is outside this series.
>
> Christian Loehle (2):
> ACPI: processor: Disable unsafe manual bind/unbind
> ACPI: processor: Prevent unsafe module unloading
>
> drivers/acpi/processor_driver.c | 26 +-------------------------
> 1 file changed, 1 insertion(+), 25 deletions(-)
>
> --
Both patches applied as 7.5 material, thanks!