From: sashiko-bot@kernel.org
To: "Hyunjung Ko" <hj351016@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: chipidea: core: cancel power_lost_work on removal
Date: Tue, 10 Nov 2026 11:19:03 +0000 [thread overview]
Message-ID: <sashiko-outbox-206926@kernel.org> (raw)
In-Reply-To: <20261110111402.2504885-1-hj351016@gmail.com>
> ci_hdrc_resume() queues ci->power_lost_work on system resume when the
> controller lost power during suspend. The work (ci_power_lost_work)
> dereferences ci: it touches ci->irq, ci->dev and switches the role.
>
> ci is allocated with devm_kzalloc(), so devres frees it after
> ci_hdrc_remove() returns. ci_hdrc_remove() never cancels power_lost_work,
> so a work queued by a resume just before unbind can run after ci has been
> freed and dereference freed memory -- a use-after-free.
>
> Cancel power_lost_work at the start of ci_hdrc_remove(), before the
> devm-allocated ci is released.
>
> Found by static analysis; not runtime-reproduced (needs a chipidea
> controller losing power across a system suspend/resume that races unbind).
>
> Fixes: cc509b6a47e7 ("usb: chipidea: core: handle power lost in workqueue")
> Cc: stable@vger.kernel.org
> Signed-off-by: Hyunjung Ko <hj351016@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261110111402.2504885-1-hj351016@gmail.com?part=1
prev parent reply other threads:[~2026-11-10 11:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 11:14 [PATCH] usb: chipidea: core: cancel power_lost_work on removal Hyunjung Ko
2026-11-10 11:19 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-206926@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=hj351016@gmail.com \
--cc=linux-usb@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox