Linux kernel use-after-free in sbs-battery polling teardown
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
power: supply: sbs-battery: disable polling before supply teardown
The managed poll-work cancellation is registered before the power supply, so cleanup unregisters the supply before draining polling. A pending or running poller can then call power_supply_changed() on the released supply.
Commit 8d59cf3887fb ("power: supply: sbs-battery: Fix use-after-free in power_supply_changed()") moved the IRQ request after supply registration, but did not change the poll-work cancellation order.
Add a later managed action that disables and drains polling before supply teardown. Its retained disabled state prevents external-power callbacks from rearming the poll work after it has been drained. Keep the original autocancel to initialize work before supply callbacks can run and to cover failed supply registration.
The teardown ordering issue was found by static analysis.
From the CVE record · Linux
During sbs-battery teardown, a pending or running poller can call power_supply_changed() on a released power supply, causing a use-after-free. The issue was found by static analysis; no attacker path, authentication requirement, or user interaction is specified.
Engineers running Linux kernels with the sbs-battery component should check their kernel version; affected versions are not specified.