[PATCH] FILS: Fix memory leak if AES-SIV encryption fails

Benjamin Berg benjamin at sipsolutions.net
Thu Jan 22 07:21:48 PST 2026


From: Benjamin Berg <benjamin.berg at intel.com>

The dynamically allocated header was not free'ed in the error path. Add
the appropriate os_free call.

Fixes: b729fd8df9f6 ("FILS: Use AEAD cipher to protect EAPOL-Key frames (AP)")
Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
---
 src/ap/wpa_auth.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
index 49268b21e2..0155a3cecb 100644
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
@@ -2178,6 +2178,7 @@ void __wpa_send_eapol(struct wpa_authenticator *wpa_auth,
 		if (aes_siv_encrypt(sm->PTK.kek, sm->PTK.kek_len, kde, kde_len,
 				    1, aad, aad_len, key_mic + 2) < 0) {
 			wpa_printf(MSG_DEBUG, "WPA: AES-SIV encryption failed");
+			os_free(hdr);
 			return;
 		}
 
-- 
2.52.0




More information about the Hostap mailing list