CVE-2026-139028: power: supply: bq27xxx: Ensure poll work is cancelled on remove
In the Linux kernel, the following vulnerability has been resolved:
power: supply: bq27xxx: Ensure poll work is cancelled on remove
The di->work poll work is queued from the poll callback itself and from bq27xxxexternalpowerchanged(). The canceldelayedworksync() in bq27xxxbatteryteardown() runs while the powersupply is still registered, so externalpowerchanged() can re-arm the work after the cancel, and it runs after the driver data has been freed.
Register a devmdelayedworkautocancel() before devmpowersupplyregister(), so on unwind the powersupply is unregistered first, after which no new externalpowerchanged() callback can be dispatched, and the poll work is cancelled only then. Drop the now-redundant cancel from bq27xxxbatteryteardown().
This issue was found by an in-house static analysis tool.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.226 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.193 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.163 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.63 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.118-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.118-1Fixed in 7.3.4-1 - Compensating control
Register devm_delayed_work_autocancel() before devm_power_supply_register(), and remove the now-redundant cancel_delayed_work_sync() from bq27xxx_battery_teardown().
Event History
Frequently Asked Questions
Which systems are exposed to this race condition?
Systems using the Linux kernel bq27xxx power-supply driver are implicated. The race occurs during driver removal or error unwinding while the power supply remains registered.
What condition is required for the use-after-free to occur?
A poll work item must be cancelled during teardown, then re-queued by bq27xxx_external_power_changed() before the power supply is unregistered. The re-armed work can subsequently run after the driver data has been freed.
Is a temporary mitigation provided if the fix cannot be deployed?
No temporary operational workaround is specified in the provided data. The described resolution changes teardown ordering so the power supply is unregistered before delayed poll work is cancelled.