Subject: CVE-2024-47718: wifi: rtw88: always wait for both firmware loading attempts

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

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

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

wifi: rtw88: always wait for both firmware loading attempts

In 'rtw_wait_firmware_completion()', always wait for both (regular and
wowlan) firmware loading attempts. Otherwise if 'rtw_usb_intf_init()'
has failed in 'rtw_usb_probe()', 'rtw_usb_disconnect()' may issue
'ieee80211_free_hw()' when one of 'rtw_load_firmware_cb()' (usually
the wowlan one) is still in progress, causing UAF detected by KASAN.

The Linux kernel CVE team has assigned CVE-2024-47718 to this issue.

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

	Issue introduced in 5.6 with commit c8e5695eae99 and fixed in 5.10.227 with commit a0c1e2da652c
	Issue introduced in 5.6 with commit c8e5695eae99 and fixed in 5.15.168 with commit ceaab3fb64d6
	Issue introduced in 5.6 with commit c8e5695eae99 and fixed in 6.1.113 with commit 7887ad11995a
	Issue introduced in 5.6 with commit c8e5695eae99 and fixed in 6.6.54 with commit 1b8178a2ae27
	Issue introduced in 5.6 with commit c8e5695eae99 and fixed in 6.10.13 with commit 9432185540ba
	Issue introduced in 5.6 with commit c8e5695eae99 and fixed in 6.11.2 with commit e9a78d9417e1
	Issue introduced in 5.6 with commit c8e5695eae99 and fixed in 6.12-rc1 with commit 0e735a4c6137

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-2024-47718
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:
	drivers/net/wireless/realtek/rtw88/main.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/a0c1e2da652cf70825739bc12d49ea15805690bf
	https://git.kernel.org/stable/c/ceaab3fb64d6a5426a3db8f87f3e5757964f2532
	https://git.kernel.org/stable/c/7887ad11995a4142671cc49146db536f923c8568
	https://git.kernel.org/stable/c/1b8178a2ae272256ea0dc4f940320a81003535e2
	https://git.kernel.org/stable/c/9432185540bafd42b7bfac6e6ef2f0a0fb4be447
	https://git.kernel.org/stable/c/e9a78d9417e167410d6fb83c4e908b077ad8ba6d
	https://git.kernel.org/stable/c/0e735a4c6137262bcefe45bb52fde7b1f5fc6c4d