HomeFreeBSD

LinuxKPI: 802.11: lkpi_sta_auth_to_scan() fail graciously on lsta == NULL

Description

LinuxKPI: 802.11: lkpi_sta_auth_to_scan() fail graciously on lsta == NULL

Usually after a firmware crash, we see reports of crashes in
lkpi_sta_auth_to_scan(). One of the last ones was in the PR
mentioned below.

These crashes are often attributed as the problem while the real
problem happened before.

At this point try avoid the NULL pointer and to fail graciously if
lvif->iv_bss (lsta) is no longer set. This way users have a chance
to possibly recover using netif restart wlan0 rather than dealing
with a panic.

See if this helps us to better track down the original problems
rather than the follow-up crash.

On a debug kernel the KASSERT should normally have caught that
condition as well but we see panics on page faults were the log
line was there but then the lsta->ni deref has happened, which is
after the KASSERT. I have not checked if this is a reordering problem
or if the people reporting had IEEE80211_DEBUG on but not INVARIANTS.

Sponsored by: The FreeBSD Foundation
PR: 286219 #c11
MFC after: 3 days

Details

Provenance
bzAuthored on Mar 8 2026, 12:48 PM
Parents
rG9c9f27e8af28: tzcode: Record merge of 2025b
Branches
Unknown
Tags
Unknown