CVE-2024-56541 Information
Description
In the Linux kernel the following vulnerability has been resolved:
wifi: ath12k: fix use-after-free in ath12k_dp_cc_cleanup()
During ath12k module removal in ath12k_core_deinit() ath12k_mac_destroy() un-registers ah->hw from mac80211 and frees the ah->hw as well as all the ar’s in it. After this ath12k_core_soc_destroy()-> ath12k_dp_free()-> ath12k_dp_cc_cleanup() tries to access one of the freed ar’s from pending skb.
This is because during mac destroy driver failed to flush few data packets which were accessed later in ath12k_dp_cc_cleanup() and freed but using ar from the packet led to this use-after-free.
BUG: KASAN: use-after-free in ath12k_dp_cc_cleanup.part.0+0x5e2/0xd40 [ath12k] Write of size 4 at addr ffff888150bd3514 by task modprobe/8926 CPU: 0 UID: 0 PID: 8926 Comm: modprobe Not tainted 6.11.0-rc2-wt-ath+ 1746 Hardware name: Intel(R) Client Systems NUC8i7HVK/NUC8i7HVB BIOS HNKBLi70.86A.0067.2021.0528.1339 05/28/2021
Call Trace:
Commit 24de1b7b231c (\wifi: ath12k: fix flush failure in recovery scenarios) added the change to decrement the pending packets count in case of recovery which make sense as ah->hw as well all ar’s in it are intact during recovery but during core deinit there is no use in decrementing packets count or waking up the empty waitq as the module is going to be removed also ar’s from pending skb’s can’t be used and the packets should just be released back.
To fix this avoid accessing ar from skb->cb when driver is being unregistered.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00214-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Reference
https://git.kernel.org/stable/c/35be5018a2a4d1b07bdfcf957c81121d22d16355 https://git.kernel.org/stable/c/bdb281103373fd80eb5c91cede1e115ba270b4e9 https://git.kernel.org/stable/c/e5e15c8b42923bfb6c84d3d906a9965d9a0f111d
Share on: