]> git.ipfire.org Git - thirdparty/hostap.git/commit
Do not remove a currently used BSS entry when removing oldest unknown BSS
authorJouni Malinen <quic_jouni@quicinc.com>
Tue, 21 Jan 2025 17:34:23 +0000 (19:34 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 21 Jan 2025 17:34:23 +0000 (19:34 +0200)
commitb0f58794420df2fcc195b160e7fd8aa4bf86be2d
tree5e91b5c470fed961983abd48fc10923a39ead0c6
parentc78295c35282d2d6d2f77d0c082b5c18d88341c5
Do not remove a currently used BSS entry when removing oldest unknown BSS

wpa_bss_known() might not be sufficient to catch all cases where a BSS
entry is in use. One known example of such a case is OWE transition mode
where the SSID of the transition mode AP is not the same as the one in
the local network profile. Some other cases might exists as well.

If the oldest unknown BSS needs to be removed due to running out of room
in the BSS table and that removed BSS happens to be the currently
associated one, wpa_s->current_bss might become invalid and point to
freed memory. This needs to be avoided to prevent use of freed memory,
so use wpa_bss_in_use() as an extra condition for removing the oldest
unknown BSS.

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