]> git.ipfire.org Git - thirdparty/hostap.git/commit
PTKSA: Fix a potential hostapd memory leak during reconfiguration
authorJouni Malinen <jouni@codeaurora.org>
Thu, 24 Jun 2021 21:20:02 +0000 (00:20 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 24 Jun 2021 21:20:02 +0000 (00:20 +0300)
commit84f8947735fc81f723fdff78881353c880631378
tree27a7a49bc0bf2290b5f08be43deae3e03f416f8a
parent311091eb43eb8a5210745b667de7146012abff02
PTKSA: Fix a potential hostapd memory leak during reconfiguration

Some of the reconfiguration cases (e.g., with WPS reconfiguration
enabling WPA/WPA2) might end up calling hostapd_setup_wpa() twice
without calling hostapd_deinit_wpa() in the middle. This would have
resulted in a memory leak since the PTKSA cache was being reinitialized
without freeing previous memory allocation.

Fix this by making PTKSA cachine initialization independent of
hapd->wpa_auth so that reinitialization does not happen in a manner that
would have overridden the old hapd->ptksa pointer without freeing the
referenced resources.

Fixes: f2f8e4f45830 ("Add PTKSA cache to hostapd")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/ap/wpa_auth_glue.c