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.
https://git.kernel.org/stable/c/fce1dd31b185ceadb9669162a5a35444b1059960
https://git.kernel.org/stable/c/5c1c602463d597c5189ddc5a73dece588ba2c57a
https://git.kernel.org/stable/c/3146e37745171f9b9b8aab48d9b8dbcb14a186e0
https://git.kernel.org/stable/c/190a92be785336a03c36450af560a79a631b192d