* [PATCH] extcon: max14577: Fix potential use-after-free on removal
@ 2026-11-26 8:25 Guangshuo Li
2026-11-26 14:38 ` Krzysztof Kozlowski
0 siblings, 1 reply; 2+ messages in thread
From: Guangshuo Li @ 2026-11-26 8:25 UTC (permalink / raw)
To: cw00.choi, krzk, myungjoo.ham, kyungmin.park; +Cc: linux-kernel
Probe queues delayed cable detection, but removal does not cancel it.
The worker can therefore run after the device resources and private
data have been released.
Use managed delayed work so cable detection is cancelled before its
extcon device and private data are released.
This issue was found by our static analysis tool under development.
Fixes: 962e56bfcf0b ("extcon: max14577: Add extcon-max14577 driver to support MUIC device")
Signed-off-by: Guangshuo Li <liguangshuo@mail.sdu.edu.cn>
---
drivers/extcon/extcon-max14577.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/extcon/extcon-max14577.c b/drivers/extcon/extcon-max14577.c
index 7eefc13e9f59..dc13f1997f41 100644
--- a/drivers/extcon/extcon-max14577.c
+++ b/drivers/extcon/extcon-max14577.c
@@ -763,7 +763,10 @@ static int max14577_muic_probe(struct platform_device *pdev)
* After completing the booting of platform, the extcon provider
* driver should notify cable state to upper layer.
*/
- INIT_DELAYED_WORK(&info->wq_detcable, max14577_muic_detect_cable_wq);
+ ret = devm_delayed_work_autocancel(&pdev->dev, &info->wq_detcable,
+ max14577_muic_detect_cable_wq);
+ if (ret)
+ return ret;
queue_delayed_work(system_power_efficient_wq, &info->wq_detcable,
delay_jiffies);
base-commit: 4dce97c6c265544342e716e62fd24bbb232590c5
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] extcon: max14577: Fix potential use-after-free on removal
2026-11-26 8:25 [PATCH] extcon: max14577: Fix potential use-after-free on removal Guangshuo Li
@ 2026-11-26 14:38 ` Krzysztof Kozlowski
0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2026-11-26 14:38 UTC (permalink / raw)
To: Guangshuo Li, cw00.choi, myungjoo.ham, kyungmin.park; +Cc: linux-kernel
On 26/11/2026 09:25, Guangshuo Li wrote:
> Probe queues delayed cable detection, but removal does not cancel it.
> The worker can therefore run after the device resources and private
> data have been released.
>
> Use managed delayed work so cable detection is cancelled before its
> extcon device and private data are released.
>
> This issue was found by our static analysis tool under development.
LLM is not a static analysis tool.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-26 14:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-26 8:25 [PATCH] extcon: max14577: Fix potential use-after-free on removal Guangshuo Li
2026-11-26 14:38 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®