CVE-2022-50533: wifi: mac80211: mlme: fix null-ptr deref on failed assoc
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
wifi: mac80211: mlme: fix null-ptr deref on failed assoc
If association to an AP without a link 0 fails, then we crash in tracing because it assumes that either ap_mld_addr or link 0 BSS is valid, since we clear sdata->vif.valid_links and then don't add the ap_mld_addr to the struct.
Since we clear also sdata->vif.cfg.ap_addr, keep a local copy of it and assign it earlier, before clearing valid_links, to fix this.
The Linux kernel CVE team has assigned CVE-2022-50533 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.0 with commit 81151ce462e533551f3284bfdb8e0f461c9220e6 and fixed in 6.0.16 with commit c695dfba8dfb82dc7ace4f22be088916cbf621ca Issue introduced in 6.0 with commit 81151ce462e533551f3284bfdb8e0f461c9220e6 and fixed in 6.1.2 with commit bb7743955a929e44b308cc3f63f8cc03873c1bee Issue introduced in 6.0 with commit 81151ce462e533551f3284bfdb8e0f461c9220e6 and fixed in 6.2 with commit 78a6a43aaf87180ec7425a2a90468e1b4d09a1ec
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2022-50533
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
net/mac80211/mlme.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/c695dfba8dfb82dc7ace4f22be088916cbf621ca https://git.kernel.org/stable/c/bb7743955a929e44b308cc3f63f8cc03873c1bee https://git.kernel.org/stable/c/78a6a43aaf87180ec7425a2a90468e1b4d09a1ec