This is a note to let you know that I've just added the patch titled wifi: ath12k: fix dfs-radar and temperature event locking to the 6.5-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: wifi-ath12k-fix-dfs-radar-and-temperature-event-locking.patch and it can be found in the queue-6.5 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 69bd216e049349886405b1c87a55dce3d35d1ba7 Mon Sep 17 00:00:00 2001 From: Johan Hovold <johan+linaro@xxxxxxxxxx> Date: Thu, 19 Oct 2023 13:36:49 +0200 Subject: wifi: ath12k: fix dfs-radar and temperature event locking From: Johan Hovold <johan+linaro@xxxxxxxxxx> commit 69bd216e049349886405b1c87a55dce3d35d1ba7 upstream. The ath12k active pdevs are protected by RCU but the DFS-radar and temperature event handling code calling ath12k_mac_get_ar_by_pdev_id() was not marked as a read-side critical section. Mark the code in question as RCU read-side critical sections to avoid any potential use-after-free issues. Note that the temperature event handler looks like a place holder currently but would still trigger an RCU lockdep splat. Compile tested only. Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Cc: stable@xxxxxxxxxxxxxxx # v6.2 Signed-off-by: Johan Hovold <johan+linaro@xxxxxxxxxx> Acked-by: Jeff Johnson <quic_jjohnson@xxxxxxxxxxx> Signed-off-by: Kalle Valo <quic_kvalo@xxxxxxxxxxx> Link: https://lore.kernel.org/r/20231019113650.9060-2-johan+linaro@xxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/net/wireless/ath/ath12k/wmi.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -6234,6 +6234,8 @@ ath12k_wmi_pdev_dfs_radar_detected_event ev->detector_id, ev->segment_id, ev->timestamp, ev->is_chirp, ev->freq_offset, ev->sidx); + rcu_read_lock(); + ar = ath12k_mac_get_ar_by_pdev_id(ab, le32_to_cpu(ev->pdev_id)); if (!ar) { @@ -6251,6 +6253,8 @@ ath12k_wmi_pdev_dfs_radar_detected_event ieee80211_radar_detected(ar->hw); exit: + rcu_read_unlock(); + kfree(tb); } @@ -6269,11 +6273,16 @@ ath12k_wmi_pdev_temperature_event(struct ath12k_dbg(ab, ATH12K_DBG_WMI, "pdev temperature ev temp %d pdev_id %d\n", ev.temp, ev.pdev_id); + rcu_read_lock(); + ar = ath12k_mac_get_ar_by_pdev_id(ab, le32_to_cpu(ev.pdev_id)); if (!ar) { ath12k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev.pdev_id); - return; + goto exit; } + +exit: + rcu_read_unlock(); } static void ath12k_fils_discovery_event(struct ath12k_base *ab, Patches currently in stable-queue which might be from johan+linaro@xxxxxxxxxx are queue-6.5/wifi-ath11k-fix-dfs-radar-event-locking.patch queue-6.5/wifi-ath11k-fix-gtk-offload-status-event-locking.patch queue-6.5/wifi-ath12k-fix-dfs-radar-and-temperature-event-locking.patch queue-6.5/wifi-ath12k-fix-htt-mlo-offset-event-locking.patch queue-6.5/wifi-ath11k-fix-htt-pktlog-locking.patch queue-6.5/wifi-ath11k-fix-temperature-event-locking.patch