CVE-2024-46755: wifi: mwifiex: Do not return unused priv in mwifiex_get_priv_by_id()

Description

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

wifi: mwifiex: Do not return unused priv in mwifiex_get_priv_by_id()

mwifiex_get_priv_by_id() returns the priv pointer corresponding to
the bss_num and bss_type, but without checking if the priv is actually
currently in use.
Unused priv pointers do not have a wiphy attached to them which can
lead to NULL pointer dereferences further down the callstack. Fix
this by returning only used priv pointers which have priv->bss_mode
set to something else than NL80211_IFTYPE_UNSPECIFIED.

Said NULL pointer dereference happened when an Accesspoint was started
with wpa_supplicant -i mlan0 with this config:

network={
ssid="somessid"
mode=2
frequency=2412
key_mgmt=WPA-PSK WPA-PSK-SHA256
proto=RSN
group=CCMP
pairwise=CCMP
psk="12345678"
}

When waiting for the AP to be established, interrupting wpa_supplicant
with and starting it again this happens:

| Unable to handle kernel NULL pointer dereference at virtual address 0000000000000140
| Mem abort info:
| ESR = 0x0000000096000004
| EC = 0x25: DABT (current EL), IL = 32 bits
| SET = 0, FnV = 0
| EA = 0, S1PTW = 0
| FSC = 0x04: level 0 translation fault
| Data abort info:
| ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
| CM = 0, WnR = 0, TnD = 0, TagAccess = 0
| GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
| user pgtable: 4k pages, 48-bit VAs, pgdp=0000000046d96000
| [0000000000000140] pgd=000...

Classification

CVE ID: CVE-2024-46755

Affected Products

Vendor: Linux

Product: Linux

Exploit Prediction Scoring System (EPSS)

EPSS Score: 0.05% (probability of being exploited)

EPSS Percentile: 16.34% (scored less or equal to compared to others)

EPSS Date: 2025-05-07 (when was this score calculated)

Stakeholder-Specific Vulnerability Categorization (SSVC)

SSVC Exploitation: none

SSVC Technical Impact: partial

SSVC Automatable: false

References

https://nvd.nist.gov/vuln/detail/CVE-2024-46755
https://git.kernel.org/stable/c/a12cf97cbefa139ef8d95081f2ea047cbbd74b7a
https://git.kernel.org/stable/c/d834433ff313838a259bb6607055ece87b895b66
https://git.kernel.org/stable/c/9813770f25855b866b8ead8155b8806b2db70f6d
https://git.kernel.org/stable/c/cb67b2e51b75f1a17bee7599c8161b96e1808a70
https://git.kernel.org/stable/c/1a05d8d02cfa3540ea5dbd6b39446bd3f515521f
https://git.kernel.org/stable/c/c2618dcb26c7211342b54520b5b148c0d3471c8a
https://git.kernel.org/stable/c/c16916dd6c16fa7e13ca3923eb6b9f50d848ad03
https://git.kernel.org/stable/c/c145eea2f75ff7949392aebecf7ef0a81c1f6c14

Timeline