Skip to content

Commit bcbc84a

Browse files
nbd168jmberg-intel
authored andcommitted
wifi: mac80211: fix race condition on enabling fast-xmit
fast-xmit must only be enabled after the sta has been uploaded to the driver, otherwise it could end up passing the not-yet-uploaded sta via drv_tx calls to the driver, leading to potential crashes because of uninitialized drv_priv data. Add a missing sta->uploaded check and re-check fast xmit after inserting a sta. Signed-off-by: Felix Fietkau <nbd@nbd.name> Link: https://msgid.link/20240104181059.84032-1-nbd@nbd.name Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent cf4a0d8 commit bcbc84a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

net/mac80211/sta_info.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,8 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
913913
if (ieee80211_vif_is_mesh(&sdata->vif))
914914
mesh_accept_plinks_update(sdata);
915915

916+
ieee80211_check_fast_xmit(sta);
917+
916918
return 0;
917919
out_remove:
918920
if (sta->sta.valid_links)

net/mac80211/tx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3048,7 +3048,7 @@ void ieee80211_check_fast_xmit(struct sta_info *sta)
30483048
sdata->vif.type == NL80211_IFTYPE_STATION)
30493049
goto out;
30503050

3051-
if (!test_sta_flag(sta, WLAN_STA_AUTHORIZED))
3051+
if (!test_sta_flag(sta, WLAN_STA_AUTHORIZED) || !sta->uploaded)
30523052
goto out;
30533053

30543054
if (test_sta_flag(sta, WLAN_STA_PS_STA) ||

0 commit comments

Comments
 (0)