CVE-2024-56593

Source
https://cve.org/CVERecord?id=CVE-2024-56593
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-56593.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-56593
Downstream
Related
Published
2024-12-27T14:51:00.466Z
Modified
2026-03-11T07:51:19.315451Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
wifi: brcmfmac: Fix oops due to NULL pointer dereference in brcmf_sdiod_sglist_rw()
Details

In the Linux kernel, the following vulnerability has been resolved:

wifi: brcmfmac: Fix oops due to NULL pointer dereference in brcmfsdiodsglist_rw()

This patch fixes a NULL pointer dereference bug in brcmfmac that occurs when a high 'sdsgentryalign' value applies (e.g. 512) and a lot of queued SKBs are sent from the pkt queue.

The problem is the number of entries in the pre-allocated sgtable, it is nents = max(rxglomsize, txglomsize) + max(rxglomsize, txglomsize) >> 4 + 1. Given the default [rt]xglomsize=32 it's actually 35 which is too small. Worst case, the pkt queue can end up with 64 SKBs. This occurs when a new SKB is added for each original SKB if tailroom isn't enough to hold tailpad. At least one sg entry is needed for each SKB. So, eventually the "skbqueuewalk loop" in brcmfsdiodsglistrw may run out of sg entries. This makes sgnext return NULL and this causes the oops.

The patch sets nents to max(rxglomsize, txglomsize) * 2 to be able handle the worst-case. Btw. this requires only 64-35=29 * 16 (or 20 if CONFIGNEEDSGDMALENGTH) = 464 additional bytes of memory.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/56xxx/CVE-2024-56593.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
af1fa210f4fc6e304b859b386a3c8a266b1110ab
Fixed
342f87d263462c2670b77ea9a32074cab2ac6fa1
Fixed
7522d7d745d13fbeff3350fe6aa56c8dae263571
Fixed
dfb3f9d3f602602de208da7bdcc0f6d5ee74af68
Fixed
67a25ea28f8ec1da8894f2f115d01d3becf67dc7
Fixed
07c020c6d14d29e5a3ea4e4576b8ecf956a80834
Fixed
34941321b516bd7c6103bd01287d71a1804d19d3
Fixed
857282b819cbaa0675aaab1e7542e2c0579f52d7

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-56593.json"