289906c88c676416042ee08244e385367972a76e
[openwrt/staging/dedeckeh.git] /
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Fri, 24 Mar 2023 13:04:17 +0100
3 Subject: [PATCH] wifi: mac80211: fix invalid drv_sta_pre_rcu_remove calls for
4 non-uploaded sta
5
6 Avoid potential data corruption issues caused by uninitialized driver
7 private data structures.
8
9 Reported-by: Brian Coverstone <brian@mainsequence.net>
10 Fixes: 6a9d1b91f34d ("mac80211: add pre-RCU-sync sta removal driver operation")
11 Signed-off-by: Felix Fietkau <nbd@nbd.name>
12 ---
13
14 --- a/net/mac80211/sta_info.c
15 +++ b/net/mac80211/sta_info.c
16 @@ -1241,7 +1241,8 @@ static int __must_check __sta_info_destr
17 list_del_rcu(&sta->list);
18 sta->removed = true;
19
20 - drv_sta_pre_rcu_remove(local, sta->sdata, sta);
21 + if (sta->uploaded)
22 + drv_sta_pre_rcu_remove(local, sta->sdata, sta);
23
24 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
25 rcu_access_pointer(sdata->u.vlan.sta) == sta)