Re: [PATCH] mmc: mmci: Fix use-after-free in busy-timeout work

Linus Walleij <[email protected]>
Newsgroups org.kernel.vger.linux-mmc,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <CAD++jLn0FbhgVasONV9phBActz47umr80GARCrdpQ+nZt7M_9A@mail.gmail.com>
On Fri, Aug 14, 2026 at 10:27 AM Fan Wu <[email protected]> wrote:

> ux500_busy_complete() can queue ux500_busy_timeout_work for an R1b
> command, but mmci_remove() never cancels it. The work can subsequently
> dereference the devm-allocated mmci_host after it has been released.
>
> Mask the controller interrupts and disable the delayed work during
> removal. This drains any queued instance and stops an IRQ handler that
> is still in progress from queueing the work again once it has been
> disabled.
>
> This issue was found by an in-house static analysis tool.
>
> Fixes: b1a665932dc2 ("mmc: mmci: Add support for SW busy-end timeouts")
> Cc: [email protected] # v6.10+
> Assisted-by: Codex:gpt-5.6
> Signed-off-by: Fan Wu <[email protected]>

Reviewed-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.