]> git.ipfire.org Git - thirdparty/hostap.git/commit
P2P: Clean wpa_s->last_ssid when removing a temporary group network
authorXin Deng <quic_deng@quicinc.com>
Tue, 11 Jul 2023 06:18:38 +0000 (23:18 -0700)
committerJouni Malinen <j@w1.fi>
Fri, 18 Aug 2023 17:29:18 +0000 (20:29 +0300)
commit47a65ccbfde21f24f28a88b378d6266e6c448949
treefe16eb6746c07edafae4c013444a7f839e2d15f5
parentfe72afe713adf4b570f7e05cc14d4c4c5ef5067e
P2P: Clean wpa_s->last_ssid when removing a temporary group network

wpa_supplicant could crash due to dereferencing freed memory in a corner
case. When a reestablished P2P GO group gets removed because the
hardware mode is not supported when switching from 2.4 to 5 GHz. Group
removal in wpas_p2p_group_delete() forget to clean wpa_s->last_ssid due
to the missing wpas_notify_network_removed() call before removing the
network with wpa_config_remove_network().

That could cause a crash when flushing old BSSs which age out in
wpa_bss_flush_by_age() which uses wpa_s->last_ssid in some cases.

Fix this by invoking wpas_notify_network_removed() to clean
wpa_s->last_ssid when removing a temporary P2P group network.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
wpa_supplicant/p2p_supplicant.c