]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Do prune_association only after the STA is authorized
authorAdil Saeed Musthafa <quic_adilm@quicinc.com>
Thu, 11 May 2023 18:43:02 +0000 (11:43 -0700)
committerJouni Malinen <j@w1.fi>
Thu, 25 May 2023 14:08:57 +0000 (17:08 +0300)
Prune-associations should be done only after the new station is
authorized. Otherwise any STA can cause denial of service to connected
stations in PMF case when more than a single interface is being
controlled by the same hostapd process.

Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
src/ap/hostapd.c
src/ap/sta_info.c

index ef8800c8c14a43d1bed68338901d9ace29799dc1..112e6fad312312a7e298eb94f5b7b9c06b5dc251 100644 (file)
@@ -3339,7 +3339,6 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
                return;
        }
 
-       hostapd_prune_associations(hapd, sta->addr);
        ap_sta_clear_disconnect_timeouts(hapd, sta);
        sta->post_csa_sa_query = 0;
 
index 0897bcda4dd1e47f95c1d6e59afd1eb0fafb8ad2..4eb41528e134cf850aa8504d6ba03d7bb8404722 100644 (file)
@@ -1280,10 +1280,12 @@ void ap_sta_set_authorized(struct hostapd_data *hapd, struct sta_info *sta,
        if (!!authorized == !!(sta->flags & WLAN_STA_AUTHORIZED))
                return;
 
-       if (authorized)
+       if (authorized) {
+               hostapd_prune_associations(hapd, sta->addr);
                sta->flags |= WLAN_STA_AUTHORIZED;
-       else
+       } else {
                sta->flags &= ~WLAN_STA_AUTHORIZED;
+       }
 
 #ifdef CONFIG_P2P
        if (hapd->p2p_group == NULL) {