]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
AP: Fix use after free in link reconfiguration
authorBenjamin Berg <benjamin.berg@intel.com>
Thu, 30 Oct 2025 08:24:32 +0000 (09:24 +0100)
committerJouni Malinen <j@w1.fi>
Sat, 13 Dec 2025 19:43:30 +0000 (21:43 +0200)
Print the station MAC address before freeing the data.

Fixes: e166a37632d4 ("AP MLD: Control interface events for ML Setup Link Reconfiguration)
CC: Mohan Kumar G <quic_mkumarg@quicinc.com>
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
src/ap/ieee802_11_eht.c

index c68900c1616f830040470dbab4991a8c4c5f5792..feeb77ebea039703e1b90fcba1adf1158f054e01 100644 (file)
@@ -1677,10 +1677,10 @@ void hostapd_link_reconf_resp_tx_status(struct hostapd_data *hapd,
                }
 
                /* Free as a link STA */
-               ap_free_sta(lhapd, lsta);
                wpa_msg(hapd->msg_ctx, MSG_INFO,
                        WPA_EVENT_LINK_STA_REMOVED "sta=" MACSTR " link_id=%u",
                        MAC2STR(lsta->addr), link_id);
+               ap_free_sta(lhapd, lsta);
 
                for_each_mld_link(other_hapd, lhapd) {
                        struct mld_link_info *link;