]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WNM: Reject requests with an invalid dialog token
authorBenjamin Berg <benjamin.berg@intel.com>
Mon, 29 Apr 2024 11:51:53 +0000 (13:51 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 2 Aug 2024 10:22:34 +0000 (13:22 +0300)
The dialog token must be non-zero. We are using this fact internally to
track the state in some cases, so ensure that the assumption is valid.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
wpa_supplicant/wnm_sta.c

index 52d8fb40fc4d2837489c1d9dff3136a5010d7466..b6c5455d60bf1cd7180be4f52ec2b96c587bc258 100644 (file)
@@ -1456,6 +1456,12 @@ static void ieee802_11_rx_bss_trans_mgmt_req(struct wpa_supplicant *wpa_s,
                   wpa_s->wnm_dialog_token, wpa_s->wnm_mode,
                   wpa_s->wnm_disassoc_timer, valid_int);
 
+       if (!wpa_s->wnm_dialog_token) {
+               wpa_printf(MSG_DEBUG, "WNM: Invalid dialog token");
+               wnm_btm_reset(wpa_s);
+               return;
+       }
+
 #if defined(CONFIG_MBO) && defined(CONFIG_TESTING_OPTIONS)
        if (wpa_s->reject_btm_req_reason) {
                wpa_printf(MSG_INFO,