CVE-2026-139011: ata: libata: Do not leave ata_host_stop() registered when activation fails
In the Linux kernel, the following vulnerability has been resolved:
ata: libata: Do not leave atahoststop() registered when activation fails
atahoststart() registers atahoststop() as a devres action as soon as it has succeeded, which hands the release of the host resources over to devres: ->portstop() and ->hoststop() are then called by the driver core when probe() fails.
atahostactivate() and ahcihostactivatemultiirqs() can both fail after atahoststart() has succeeded, e.g. if devmrequestirq() or atahostregister() fails, and they return the error with the devres action still registered. A driver which releases the host resources in its probe() error path therefore releases them twice: once itself and once through ->hoststop().
All ahci-platform drivers are in that situation, e.g. ahciprobe() calls ahciplatformdisableresources() while ahcihoststop() does the same through devres. This gives refcount underflow warnings from the clk, regulator and phy cores and, for shared resources, can disable resources which are still in use by other devices.
Add atahostundostart(), which stops the ports and drops the devres action without calling ->hoststop(), and call it from both activation helpers when they fail. Releasing the host resources on failure is then always left to the caller, which is what all callers having a probe() error path already assume.
This changes the semantics for the drivers which implement ->hoststop() while also completely lacking error handling for the activate host call. Add activate host error handling for sataqstor and satafsl. For satafsl this also means that hcrbase and hostpriv are now released when activating the host fails, which ->hoststop() did not do when atahoststart() itself failed.
Note that atapcisffactivatehost() is deliberately left as is: none of its callers releases the host resources in its probe() error path, they all rely on ->hoststop() being called by devres, including atapciinitone(), which releases the devres group of the host itself.
Affected Software
Event History
Frequently Asked Questions
Which systems are most likely to be affected?
The issue affects Linux systems using libata drivers whose probe error paths release host resources after ata_host_start() has succeeded but activation later fails. The description specifically identifies all ahci-platform drivers as being in this situation.
What conditions are needed to trigger the problem?
Driver initialization must fail after ata_host_start() succeeds, such as when devm_request_irq() or ata_host_register() fails in ata_host_activate() or ahci_host_activate_multi_irqs(). The driver must then perform its own host-resource cleanup in the probe error path while the devres ata_host_stop() action remains registered.
What are the operational consequences if it is triggered?
Resources can be released twice, producing reference-count underflow warnings from clock, regulator, and PHY cores. If the affected resources are shared, the double cleanup can disable resources that are still being used by other devices.
How does the fix prevent the double release?
The fix adds ata_host_undo_start(), which stops the ports and removes the devres action without calling the host stop callback. This lets the driver's probe error path clean up host resources without a later devres-triggered second release.