]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
PASN: Fix passing own address and peer address to pasn_deauthenticate()
authorVinay Gannevaram <quic_vganneva@quicinc.com>
Fri, 11 Nov 2022 18:45:36 +0000 (00:15 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 25 Nov 2022 14:47:42 +0000 (16:47 +0200)
Need to copy own address and peer address locally and pass them to
pasn_deauthenticate(), because this pointer data will be flushed from
the PTKSA cache before sending the Deauthentication frame and these
pointers to then-freed memory would be dereferenced.

Fixes: 24929543 ("PASN: Deauthenticate on PTKSA cache entry expiration")
Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
wpa_supplicant/pasn_supplicant.c

index a8d4e919bb529f3f3281d75bdbb510e71fb05483..fbef7f2dff98fd42834863a131a4a918f886c66d 100644 (file)
@@ -781,8 +781,14 @@ static int wpas_pasn_immediate_retry(struct wpa_supplicant *wpa_s,
 static void wpas_pasn_deauth_cb(struct ptksa_cache_entry *entry)
 {
        struct wpa_supplicant *wpa_s = entry->ctx;
+       u8 own_addr[ETH_ALEN];
+       u8 peer_addr[ETH_ALEN];
 
-       wpas_pasn_deauthenticate(wpa_s, entry->own_addr, entry->addr);
+       /* Use a copy of the addresses from the entry to avoid issues with the
+        * entry getting freed during deauthentication processing. */
+       os_memcpy(own_addr, entry->own_addr, ETH_ALEN);
+       os_memcpy(peer_addr, entry->addr, ETH_ALEN);
+       wpas_pasn_deauthenticate(wpa_s, own_addr, peer_addr);
 }