power: supply: ucs1002: fix use-after-free on remove
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 81196e2e57fc5b88f6b8ca98372a3dde047aa49d · < 39b60d615dfa1725c235351fb12bc72e5f8a8d32| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
power: supply: ucs1002: fix use-after-free on remove
ucs1002 has no remove callback, so unbind runs entirely through devm. The alert IRQ handler queues the health_poll delayed work, and the work reschedules itself while the chip reports a bad-health condition. devm frees the alert IRQ, which only synchronizes the handler; it does not cancel the delayed work, which can then run after devm frees the driver data and dereference it.
Register health_poll with devm_delayed_work_autocancel() before the alert IRQ is requested. devm then frees the IRQ before cancelling the work, so the handler can no longer queue it and the work is cancelled before the driver data is freed.
This issue was found by an in-house static analysis tool.
From the CVE record · Linux
The ucs1002 driver can leave delayed health-check work running when the device is unbound, causing it to access freed driver data. The input does not describe an attacker path, authentication requirements, or user interaction.
Engineers running Linux kernels with the ucs1002 power supply driver should check whether their kernel includes the fix; affected versions are not specified.