wifi: brcmfmac: make release_scratchbuffers idempotent
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 4684997d9eea29380000e062755aa6d368d789a3 · < 044fca8f45ba9ab6ca526163155234cf88287ff5| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
wifi: brcmfmac: make release_scratchbuffers idempotent
brcmf_pcie_release_scratchbuffers() frees the shared.scratch and shared.ringupd DMA buffers with dma_free_coherent() but does not clear the pointers afterwards, unlike the sibling release_ringbuffers() which NULLs commonrings/flowrings/idxbuf on release.
Both the bus_reset .reset callback (brcmf_pcie_reset) and brcmf_pcie_remove() call release_scratchbuffers. When reset teardown has run before removal, remove's own teardown would call dma_free_coherent() a second time on the already-freed DMA allocation.
NULL the pointers after free, matching release_ringbuffers(), so a later release observes that the allocation has already been released. This patch makes repeated sequential release safe; the reset-work lifetime is handled separately by the following patch.
This issue was found by an in-house static analysis tool.
From the CVE record · Linux
The Linux kernel’s brcmfmac PCIe driver can free scratch DMA buffers twice when reset teardown runs before device removal. The input does not identify an attacker-controlled trigger or specify network access, authentication, or user interaction requirements.
Engineers running Linux kernels with the brcmfmac PCIe driver should check their kernel versions; affected versions are not specified.