mmc: hsq: Fix use-after-free in retry work
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
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.
From the CVE record · Linux
The Linux kernel’s MMC HSQ retry work can run after its memory is freed if the work is still pending when the driver is removed. This can dereference freed data; the input does not establish an attacker path or specify network access, authentication, or user-interaction requirements.
Engineers running Linux kernels that use MMC HSQ, particularly with the sdhci-sprd driver, should check whether their kernel is affected; no affected versions were provided.