Skip to content

Commit 4f2bdb3

Browse files
nbd168jmberg-intel
authored andcommitted
wifi: mac80211: check/clear fast rx for non-4addr sta VLAN changes
When moving a station out of a VLAN and deleting the VLAN afterwards, the fast_rx entry still holds a pointer to the VLAN's netdev, which can cause use-after-free bugs. Fix this by immediately calling ieee80211_check_fast_rx after the VLAN change. Cc: stable@vger.kernel.org Reported-by: ranygh@riseup.net Signed-off-by: Felix Fietkau <nbd@nbd.name> Link: https://msgid.link/20240316074336.40442-1-nbd@nbd.name Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 27f8f10 commit 4f2bdb3

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

net/mac80211/cfg.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,15 +2199,14 @@ static int ieee80211_change_station(struct wiphy *wiphy,
21992199
}
22002200

22012201
if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
2202-
sta->sdata->u.vlan.sta) {
2203-
ieee80211_clear_fast_rx(sta);
2202+
sta->sdata->u.vlan.sta)
22042203
RCU_INIT_POINTER(sta->sdata->u.vlan.sta, NULL);
2205-
}
22062204

22072205
if (test_sta_flag(sta, WLAN_STA_AUTHORIZED))
22082206
ieee80211_vif_dec_num_mcast(sta->sdata);
22092207

22102208
sta->sdata = vlansdata;
2209+
ieee80211_check_fast_rx(sta);
22112210
ieee80211_check_fast_xmit(sta);
22122211

22132212
if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) {

0 commit comments

Comments
 (0)