Skip to content

Commit

Permalink
wifi: mac80211: fix race condition on enabling fast-xmit
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://msgid.link/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
nbd168 authored and jmberg-intel committed Jan 18, 2024
1 parent cf4a0d8 commit bcbc84a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions net/mac80211/sta_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,8 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
if (ieee80211_vif_is_mesh(&sdata->vif))
mesh_accept_plinks_update(sdata);

ieee80211_check_fast_xmit(sta);

return 0;
out_remove:
if (sta->sta.valid_links)
Expand Down
2 changes: 1 addition & 1 deletion net/mac80211/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3048,7 +3048,7 @@ void ieee80211_check_fast_xmit(struct sta_info *sta)
sdata->vif.type == NL80211_IFTYPE_STATION)
goto out;

if (!test_sta_flag(sta, WLAN_STA_AUTHORIZED))
if (!test_sta_flag(sta, WLAN_STA_AUTHORIZED) || !sta->uploaded)
goto out;

if (test_sta_flag(sta, WLAN_STA_PS_STA) ||
Expand Down

0 comments on commit bcbc84a

Please sign in to comment.