Page MenuHomeFreeBSD

net80211: make sure to not start a BGSCAN if not enabled
ClosedPublic

Authored by bz on Sat, May 24, 5:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 28, 11:46 AM
Unknown Object (File)
Tue, May 27, 2:59 PM
Unknown Object (File)
Tue, May 27, 11:31 AM
Unknown Object (File)
Tue, May 27, 10:17 AM

Details

Summary

On drivers not supporting background scanning (not having announced
IEEE80211_C_BGSCAN) we repeatedly have seen scanning issues and
BGSCAN was "on" according to, e.g., ddb show com /a.

Turns out there are multiple problems:
(a) the ioctl scanreq code can pass IEEE80211_[IOC_]SCAN_BGSCAN in
(ifconfig wlanX scan will do so by default). That flag ends up
on flags in the scanning code which have no other checks, and
we are doing a BGSCAN.
So make sure BGSCAN is announced by the driver and enabled
(and it's STA mode for the full check) or filter the BGSCAN out.

(b) ieee80211_bg_scan() never checked if background scanning was
available/enabled. Do so now.

(c) ieee80211_swscan_start_scan_locked() as a consequence of (a) would
start the BGSCAN unconditionally. Also check for BGSCAN to be
available/enabled here.

Lastly, we should no longer reach ieee80211_swscan_bg_scan() without
background scanning being available/enabled, so document that fact
by placing a KASSERT. That will also help in case future changes
will open a new hole or there are further which I have not noticed.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Test Plan

Make lots of people with lots of drivers test this.
I have so far not tested with any driver doing BGSCAN!

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 64410
Build 61294: arc lint + arc unit

Event Timeline

bz requested review of this revision.Sat, May 24, 5:12 PM
bz added inline comments.
sys/net80211/ieee80211_ioctl.c
2601

driver

bz retitled this revision from net80211: make sure to not start a BGSCAN is not enabled to net80211: make sure to not start a BGSCAN if not enabled.Sat, May 24, 5:31 PM
This revision is now accepted and ready to land.Sun, May 25, 5:00 PM