mmc: davinci: avoid NULL deref of host->data in IRQ handler
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b4cff4549b7a8c5fc8b88e3493b6287555f0512c · < 5b7e151fe9ea9311ba601849aaecdc4fc97fd577| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
mmc: davinci: avoid NULL deref of host->data in IRQ handler
mmc_davinci_irq() returns early only when both host->cmd and host->data are NULL:
if (host->cmd == NULL && host->data == NULL) { ... return IRQ_NONE; }
So we may legitimately reach the rest of the handler with host->data == NULL (and therefore data == NULL). The DATDNE branch already guards against this with an explicit "if (data != NULL)" check, but the subsequent TOUTRD ("read data timeout") and CRCWR/CRCRD ("data CRC error") branches dereference data unconditionally:
if (qstatus & MMCST0_TOUTRD) { data->error = -ETIMEDOUT; <-- NULL deref ... davinci_abort_data(host, data); }
if (qstatus & (MMCST0_CRCWR | MMCST0_CRCRD)) { data->error = -EILSEQ; <-- NULL deref ... }
If either bit is set in qstatus while host->data is NULL, the kernel will crash inside the IRQ handler. smatch flags this:
From the CVE record · Linux
The Linux kernel’s DaVinci MMC interrupt handler can dereference a NULL pointer when a read timeout or data CRC error occurs while host->data is NULL, causing a kernel crash. The input does not establish whether an attacker can trigger this condition or specify network access, authentication, or user-interaction requirements.
Engineers running Linux kernels that include the DaVinci MMC driver should check their kernel; affected versions were not specified.