power: supply: twl4030_charger: cancel workers via devm
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d6ccc442b12102414c1343f0adacaa8a1aaa516c · < b955da82db4170bdf1c784dc457287aa0c977378| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
power: supply: twl4030_charger: cancel workers via devm
bci is devm-allocated. Two workers (bci->work and bci->current_worker) dereference it. twl4030_bci_remove() disables charging and masks interrupts. It cancels neither worker. A worker pending at remove() can run after devm frees bci.
The USB transceiver comes from devm_usb_get_phy_by_node(). devm unregisters its notifier only after remove() returns. A cancel_work_sync() in remove() can then race a notifier reschedule. devm_work_autocancel() and devm_delayed_work_autocancel() avoid that. They cancel the workers during devm release, before bci is freed.
The current_worker is registered first, since devm will cancel in reverse order and bci->work can reschedule current_worker.
[Move comment about order into the commit message]
From the CVE record · Linux
The Linux kernel’s twl4030 charger driver can leave workers running after their device-managed data is freed. This can cause a use-after-free if a worker is pending when the device is removed. The input does not specify an attack path, authentication requirement, or user interaction.
Engineers running Linux kernels with the twl4030 charger driver should check their kernel version; affected versions are not specified.