diff options
| author | Fan Wu <fanwu01@zju.edu.cn> | 2026-08-14 08:23:54 +0000 |
|---|---|---|
| committer | Ulf Hansson <ulfh@kernel.org> | 2026-09-04 10:45:40 +0200 |
| commit | 5d132990475f02cfa1debe03d50b479432864ebd (patch) | |
| tree | a7cf76f8e5366c7ea8269436f478de509048e79f /scripts/Makefile.thinlto | |
| parent | d3a421c82412344022982d5b91ba23194a0a6f29 (diff) | |
| download | linux-next-5d132990475f02cfa1debe03d50b479432864ebd.tar.gz linux-next-5d132990475f02cfa1debe03d50b479432864ebd.zip | |
mmc: hsq: Fix use-after-free in retry work
mmc_hsq_pump_requests() queues retry_work when request_atomic() returns
-EBUSY; today sdhci-sprd is the only consumer that implements
request_atomic(). The work is embedded in a devm-allocated mmc_hsq, but
is never cancelled during driver removal. Work still pending at unbind
can therefore run after the devm allocation has been released and
dereference hsq->mmc and hsq->mrq.
Use devm_work_autocancel() to cancel and drain retry_work before the devm
allocation is released. By the time devres cleanup begins,
mmc_remove_host() has already stopped the host, so no new requests can
arm the work.
This issue was found by an in-house static analysis tool.
Fixes: 6db96e5810e0 ("mmc: host: Introduce the request_atomic() for the host")
Cc: stable@vger.kernel.org
Assisted-by: Codex:gpt-5.6
Signed-off-by: Fan Wu <fanwu01@zju.edu.cn>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
