HomeFreeBSD

net80211: fix a NULL deref in ieee80211_sta_join1()

Description

net80211: fix a NULL deref in ieee80211_sta_join1()

When ieee80211_sta_join1() gets an obss without ni_nt trying to lock
that will cause a NULL pointer deref. Check for the table to be
valid and deal with the obss node accordingly.

This can happen if sta_newstate() calls ieee80211_reset_bss() for
nstate == INIT and ostate != INIT. ieee80211_reset_bss() itself
calls ieee80211_node_table_reset() which calls node_reclaim()
which ends up in ieee80211_del_node_nt() which does remove the
node from the table and sets ni_table to NULL.
That node (former iv_bss) can then be returned as obss in the
(*iv_update_bss)() call in join1().

MFC after: 3 days
Reviewed by: adrian, cc
Differential Revision: https://reviews.freebsd.org/D43469

Details

Provenance
bzAuthored on Jan 16 2024, 6:53 PM
Reviewer
adrian
Differential Revision
D43469: net80211: fix a NULL deref in ieee80211_sta_join1()
Parents
rG2d9d35837d8e: LinuxKPI: implement memset_after()
Branches
Unknown
Tags
Unknown