Commit 85176a3f authored by Johannes Berg's avatar Johannes Berg

wifi: mac80211: check link ID in auth/assoc continuation

Ensure that the link ID matches in auth/assoc continuation,
otherwise we need to reset all the data.

Fixes: 81151ce4 ("wifi: mac80211: support MLO authentication/association with one link")
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 78a6a43a
...@@ -390,6 +390,7 @@ struct ieee80211_mgd_auth_data { ...@@ -390,6 +390,7 @@ struct ieee80211_mgd_auth_data {
bool done, waiting; bool done, waiting;
bool peer_confirmed; bool peer_confirmed;
bool timeout_started; bool timeout_started;
int link_id;
u8 ap_addr[ETH_ALEN] __aligned(2); u8 ap_addr[ETH_ALEN] __aligned(2);
......
...@@ -6702,6 +6702,7 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, ...@@ -6702,6 +6702,7 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
req->ap_mld_addr ?: req->bss->bssid, req->ap_mld_addr ?: req->bss->bssid,
ETH_ALEN); ETH_ALEN);
auth_data->bss = req->bss; auth_data->bss = req->bss;
auth_data->link_id = req->link_id;
if (req->auth_data_len >= 4) { if (req->auth_data_len >= 4) {
if (req->auth_type == NL80211_AUTHTYPE_SAE) { if (req->auth_type == NL80211_AUTHTYPE_SAE) {
...@@ -6720,7 +6721,8 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, ...@@ -6720,7 +6721,8 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
* removal and re-addition of the STA entry in * removal and re-addition of the STA entry in
* ieee80211_prep_connection(). * ieee80211_prep_connection().
*/ */
cont_auth = ifmgd->auth_data && req->bss == ifmgd->auth_data->bss; cont_auth = ifmgd->auth_data && req->bss == ifmgd->auth_data->bss &&
ifmgd->auth_data->link_id == req->link_id;
if (req->ie && req->ie_len) { if (req->ie && req->ie_len) {
memcpy(&auth_data->data[auth_data->data_len], memcpy(&auth_data->data[auth_data->data_len],
...@@ -7044,7 +7046,8 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, ...@@ -7044,7 +7046,8 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
/* keep sta info, bssid if matching */ /* keep sta info, bssid if matching */
match = ether_addr_equal(ifmgd->auth_data->ap_addr, match = ether_addr_equal(ifmgd->auth_data->ap_addr,
assoc_data->ap_addr); assoc_data->ap_addr) &&
ifmgd->auth_data->link_id == req->link_id;
ieee80211_destroy_auth_data(sdata, match); ieee80211_destroy_auth_data(sdata, match);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment