Skip to contentSkip to conversation

CVE-2022-50831: wifi: mac80211: fix MBSSID parsing use-after-free

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Dec 30, 2025

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

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

wifi: mac80211: fix MBSSID parsing use-after-free

commit ff05d4b45dd89b922578dac497dcabf57cf771c6

When we parse a multi-BSSID element, we might point some element pointers into the allocated nontransmitted_profile. However, we free this before returning, causing UAF when the relevant pointers in the parsed elements are accessed.

Fix this by not allocating the scratch buffer separately but as part of the returned structure instead, that way, there are no lifetime issues with it.

The scratch buffer introduction as part of the returned data here is taken from MLO feature work done by Ilan.

This fixes CVE-2022-42719.

The Linux kernel CVE team has assigned CVE-2022-50831 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.2 with commit 5023b14cf4df4d22e1a80738167f3438c9e62e5f and fixed in 5.15.74 with commit de124365a7d2deed22cf706583930f28d537ff0f

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-50831

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/ieee80211_i.h
	net/mac80211/util.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/de124365a7d2deed22cf706583930f28d537ff0f