HIGH
mmc CardDetect UAF
CVE-2026-89440
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI6.4MEDIUM
01Description
In the Linux kernel, the following vulnerability has been resolved: mmc: via-sdmmc: stop card-detect handling on probe failure request_irq() registers the SD card-detect interrupt and the probe enables it before mmc_add_host() runs. If mmc_add_host() fails, the error path only unmaps the registers and returns: the interrupt stays registered, so the handler keeps running against the host once it is freed. via_sdc_isr() dereferences sdhost and its MMIO base and schedules carddet_work, which via_sdc_card_detect() also runs against freed memory through its container_of() dereference. Add a probe-error path that disables and frees the interrupt and cancels carddet_work before unmapping. carddet_work can re-enable the device interrupt via via_reset_pcictrl(), which restores PCIINTCTRL, so mask it again after cancelling the work. This issue was found by an in-house static analysis tool and confirmed by manual code review.
02KernelScan AI Analysis
Risk summary
A use-after-free in the VIA SD/MMC host controller driver occurs when a probe failure leaves a card-detect interrupt registered and enabled after the host structure has been freed. An attacker with physical access to the SD card slot can trigger the interrupt, causing the handler and its deferred work to dereference freed memory. This can lead to kernel memory corruption, information disclosure, or a system crash.
Vulnerability analysis
The driver enables the card-detect interrupt before confirming that the MMC host has been successfully added. If host registration fails, the error path frees the driver data and unmaps hardware registers, but leaves the interrupt running. The interrupt handler and its background work then access freed memory, causing a use-after-free. The fix corrects the error path to disable and release the interrupt and cancel any pending work before freeing memory, and ensures the interrupt stays off afterward because the cancelled work could re-enable it. This can only be triggered on systems with the VIA SD/MMC controller, and requires an attacker to insert or remove an SD card to generate a card-detect interrupt after driver probe has failed.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.0 | 6.0.16 | 6.1 | 088eaa92fceb |
| 5.10 | 5.10.163 | 5.10.270 | 5bb5327b92aa |
| 6.1 | 6.1.2 | 6.1.188 | 806409f12fdb |
| 4.19 | 4.19.270 | 4.20 | 2550f89589ca |
| 5.4 | 5.4.229 | 5.5 | c2b8a6249119 |
| 6.6 | — | 6.6.157 | — |
| 6.12 | — | 6.12.109 | — |
| 6.18 | — | 6.18.50 | — |
| 7.2 | — | 7.2.4 | — |
| mainline | — | 7.3-rc1 | — |
| 4.9 | 4.9.337 | 4.10 | dde5b9c91e9f |
| 4.14 | 4.14.303 | 4.15 | efe7f25dd27e |
| 5.15 | 5.15.86 | 5.15.221 | d045596706d1 |
| cip/6.12 | — | 6.12.111-cip32 | efe7f25dd27e |