Skip to content

Commit d87c3ca

Browse files
committed
wifi: mac80211: finish link init before RCU publish
Since the link/conf pointers can be accessed without any protection other than RCU, make sure the data is actually set up before publishing the structures. Fixes: b2e8434 ("wifi: mac80211: set up/tear down client vif links properly") Link: https://patch.msgid.link/20250624130749.9a308b713c74.I4a80f5eead112a38730939ea591d2e275c721256@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 7a3750f commit d87c3ca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/mac80211/link.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ void ieee80211_link_init(struct ieee80211_sub_if_data *sdata,
9393
if (link_id < 0)
9494
link_id = 0;
9595

96-
rcu_assign_pointer(sdata->vif.link_conf[link_id], link_conf);
97-
rcu_assign_pointer(sdata->link[link_id], link);
98-
9996
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
10097
struct ieee80211_sub_if_data *ap_bss;
10198
struct ieee80211_bss_conf *ap_bss_conf;
@@ -145,6 +142,9 @@ void ieee80211_link_init(struct ieee80211_sub_if_data *sdata,
145142

146143
ieee80211_link_debugfs_add(link);
147144
}
145+
146+
rcu_assign_pointer(sdata->vif.link_conf[link_id], link_conf);
147+
rcu_assign_pointer(sdata->link[link_id], link);
148148
}
149149

150150
void ieee80211_link_stop(struct ieee80211_link_data *link)

0 commit comments

Comments
 (0)