diff options
| author | Fan Wu <fanwu01@zju.edu.cn> | 2026-08-02 05:12:49 +0000 |
|---|---|---|
| committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2026-08-04 00:57:24 +0200 |
| commit | 609af0ceeaefdfa42cd01dd060b20f2e41f9a232 (patch) | |
| tree | af1ef325fea136c23ca9df3f2e97c49215575d54 /tools/perf/scripts/python/parallel-perf.py | |
| parent | 831c29a12d560f8a3225f43050b3fbb5dfd79c66 (diff) | |
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.
Fixes: 81196e2e57fc ("power: supply: ucs1002: fix some health status issues")
Cc: stable@vger.kernel.org
Assisted-by: Codex:gpt-5.6
Signed-off-by: Fan Wu <fanwu01@zju.edu.cn>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Link: https://patch.msgid.link/20260802051249.424015-1-fanwu01@zju.edu.cn
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'tools/perf/scripts/python/parallel-perf.py')
0 files changed, 0 insertions, 0 deletions
