mmc: mxcmmc: cancel data work and watchdog on remove
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ f6ad0a481342223b2e7ae9f55b154e14f1391ada · < 23383e0578b58ba2dc0730cf9f7806bd66bf859a| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
mmc: mxcmmc: cancel data work and watchdog on remove
mxcmci_remove() frees the host through the devm tail, but neither it nor mmc_remove_host() drains the driver's own asynchronous state. host->watchdog, a 10 s timer armed on the DMA path in mxcmci_setup_data(), is deleted only by the DMA- and IRQ-complete paths, which the remove path does not explicitly drain; it can therefore fire after the host is freed and dereference it in mxcmci_watchdog(). host->datawork, armed from the IRQ handler on the PIO path, is not cancelled by the remove path either.
Free the devm-registered IRQ, then cancel datawork and delete the watchdog in mxcmci_remove(), before dma_release_channel(). Freeing the IRQ first keeps a trailing handler from re-arming datawork between the cancel and the host free. Both callbacks are non-self-rearming.
This issue was found by an in-house static analysis tool.
From the CVE record · Linux
The Linux kernel’s mxcmmc driver can access a freed host if its watchdog timer or data work runs after the host is removed. This could cause a use-after-free; the input does not establish an attacker path, authentication requirement, or user interaction requirement.
Operators running Linux kernels with the mxcmmc driver should check their exposure; affected versions are not specified.