HIGH Introduced in 5.8
mmc RetryWork UAF
CVE-2026-98212
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
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.
02KernelScan AI Analysis
Risk summary
A use-after-free in the MMC host software queue (mmc_hsq) driver allows a local user to trigger kernel memory corruption by causing MMC I/O activity that arms a retry work item, then having the driver unbind while that work is still pending. The freed structure is dereferenced by the stale work handler, potentially leading to kernel crash or arbitrary memory read/write. This specifically affects systems using the Spreadtrum sdhci-sprd SD host controller.
Vulnerability analysis
The driver uses a background work item to retry requests when the SD card is busy. This work item belongs to a data structure that is freed during driver removal. If the work item is still waiting to run when the driver is removed, the cleanup frees the structure first, and the work item later accesses memory that has already been freed. The fix ensures the work item is cancelled and finishes before the structure is released. A local user can trigger the issue by performing I/O on a system that uses the Spreadtrum SD host controller, the only hardware that uses the atomic request path which arms the retry work.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.12 | 5.8 | 6.12.112 | df2eb59fd9eb |
| 6.18 | 5.8 | 6.18.54 | 8439bf262ce3 |
| 6.6 | 5.8 | 6.6.158 | c50d6515bffb |
| 7.2 | 5.8 | 7.2.8 | 45341b341642 |
| mainline | 5.8 | 7.3 | 5d132990475f |
| cip/6.12 | 5.8 | 6.12.112-cip33 | df2eb59fd9eb |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.112-cip33 |
| cip/6.1 | Affected — no CIP fix yet (latest 6.1.190-cip62) |
| cip/6.1-rt | Affected — no CIP fix yet (latest 6.1.189-cip61-rt32) |
| cip/5.10 | Affected — no CIP fix yet (latest 5.10.272-cip79) |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.272-cip79-rt35) |