wifi: mac80211: fix use-after-free
authorJohannes Berg <johannes.berg@intel.com>
Wed, 17 Aug 2022 08:44:05 +0000 (10:44 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 25 Aug 2022 08:41:00 +0000 (10:41 +0200)
We've already freed the assoc_data at this point, so need
to use another copy of the AP (MLD) address instead.

Fixes: 81151ce462e5 ("wifi: mac80211: support MLO authentication/association with one link")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/mlme.c

index 3d4ab711f0d1ebd5d4584d36e23909b3b894bdd1..04d35cd398898fe96681152678cb7a8c4387b365 100644 (file)
@@ -5124,7 +5124,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
        resp.req_ies = ifmgd->assoc_req_ies;
        resp.req_ies_len = ifmgd->assoc_req_ies_len;
        if (sdata->vif.valid_links)
-               resp.ap_mld_addr = assoc_data->ap_addr;
+               resp.ap_mld_addr = sdata->vif.cfg.ap_addr;
        cfg80211_rx_assoc_resp(sdata->dev, &resp);
 notify_driver:
        drv_mgd_complete_tx(sdata->local, sdata, &info);