HomeFreeBSD

LinuxKPI: 802.11: close race lkpi_sta_scan_to_auth()/(*iv_update_bss)()

Description

LinuxKPI: 802.11: close race lkpi_sta_scan_to_auth()/(*iv_update_bss)()

We have to unlock the net80211 ic lock in order to be able to call
sleepable downcalls to the driver/firmware; a 2nd thread may go through
net80211::join1() and (*iv_update_bss)() after we checked and unlocked.
Re-check status at the end of the function under the ic lock so that we
do not accidentally set lvif_bss_synched to true again despite it no
longer being true.

This should fix a race where we lost the (*iv_update_bss)() state
during startup where one SCAN->AUTH is followed by a (then) AUTH->AUTH
and lkpi_sta_a_to_a() did the wrong thing.

Once we re-consider net80211 state and allowing a second join
on a different node or iv_bss update without previously tearing down
the older node we can likely undo a lot of these extra checks and
workarounds.

Sponsored by: The FreeBSD Foundation (updated version)
Tested by: emaste (on and off)
MFC after: 3 days
Reviewd by: cc
Differential Revision: https://reviews.freebsd.org/D43967

Details

Provenance
bzAuthored on Feb 18 2024, 8:57 PM
Differential Revision
D43967: LinuxKPI: 802.11: close race lkpi_sta_scan_to_auth()/(*iv_update_bss)()
Parents
rG3e0915b7b685: LinuxKPI: 802.11: Fix definition of IEEE80211_HT_CAP_RX_STBC
Branches
Unknown
Tags
Unknown