Skip to content

Commit 1dea3c0

Browse files
jhovoldkvalo
authored andcommitted
wifi: ath11k: fix gtk offload status event locking
The ath11k active pdevs are protected by RCU but the gtk offload status event handling code calling ath11k_mac_get_arvif_by_vdev_id() was not marked as a read-side critical section. Mark the code in question as an RCU read-side critical section to avoid any potential use-after-free issues. Compile tested only. Fixes: a16d9b5 ("ath11k: support GTK rekey offload") Cc: [email protected] # 5.18 Cc: Carl Huang <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Acked-by: Jeff Johnson <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3f77c7d commit 1dea3c0

File tree

1 file changed

+5
-2
lines changed
  • drivers/net/wireless/ath/ath11k

1 file changed

+5
-2
lines changed

drivers/net/wireless/ath/ath11k/wmi.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8618,12 +8618,13 @@ static void ath11k_wmi_gtk_offload_status_event(struct ath11k_base *ab,
86188618
return;
86198619
}
86208620

8621+
rcu_read_lock();
8622+
86218623
arvif = ath11k_mac_get_arvif_by_vdev_id(ab, ev->vdev_id);
86228624
if (!arvif) {
86238625
ath11k_warn(ab, "failed to get arvif for vdev_id:%d\n",
86248626
ev->vdev_id);
8625-
kfree(tb);
8626-
return;
8627+
goto exit;
86278628
}
86288629

86298630
ath11k_dbg(ab, ATH11K_DBG_WMI, "event gtk offload refresh_cnt %d\n",
@@ -8640,6 +8641,8 @@ static void ath11k_wmi_gtk_offload_status_event(struct ath11k_base *ab,
86408641

86418642
ieee80211_gtk_rekey_notify(arvif->vif, arvif->bssid,
86428643
(void *)&replay_ctr_be, GFP_ATOMIC);
8644+
exit:
8645+
rcu_read_unlock();
86438646

86448647
kfree(tb);
86458648
}

0 commit comments

Comments
 (0)