Page MenuHomeFreeBSD

net80211: workaround a beacon setup crash race w/ ieee80211_getcapinfo()
Needs ReviewPublic

Authored by adrian on Wed, Mar 26, 3:50 AM.

Details

Reviewers
None
Group Reviewers
wireless
Summary

There's a race during beacon setup and VAP setup/interface up that
is easily triggered by configuring AP interfaces in rc.conf and letting
the rc system bring things up.

ic->ic_curchan has a channel (which is a legacy hold over anyway),
but ni->ni_chan is set to IEEE80211_CHAN_ANYC. So, the BSS stuff
is (surprise!) not quite setup by the time the newstate path is
run (newstate_cb -> ath_newstate into RUN state -> ath_beacon_alloc()
-> ieee80211_beacon_alloc() -> ieee80211_beacon_construct() ->
ieee80211_getcapinfo()) and things explode.

This is definitely the wrong place to solve this problem though,
and when it's actually solved, a KASSERT belongs here instead.

In the meantime, this will just set up an incomplete capinfo field
until the next beacon update, at which point there'll (hopefully!) be
a valid BSS ni->ni_chan.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 63132
Build 60016: arc lint + arc unit

Event Timeline

thj added inline comments.
sys/net80211/ieee80211_output.c
2678

Should there also be a check for IEEE80211_CHAN_ANY here? I don't know if it makes sense of empty capinfo to have SHSLOT set