Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: fix no-op authorized transitions

When userspace attempts to authorize a station
that is already authorized, nothing happens as
you'd expect. Similarly, when it unauthorizes
a station that is associated, nothing happens.

However, when it unauthorizes a station that
isn't even associated yet, we erroneously try
to move the station to associated. This seems
to happen occasionally as a result of a race
when wpa_supplicant attempts to unauthorize
the port in managed mode. Particularly with my
new patches to keep stations, it can then move
a station into ASSOCIATED state before we have
really associated, which is really confusing.

I introduced this bug in
"mac80211: refactor station state transitions"

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Johannes Berg and committed by
John W. Linville
543d1b92 dfd00c4c

+1 -1
+1 -1
net/mac80211/cfg.c
··· 791 791 if (set & BIT(NL80211_STA_FLAG_AUTHORIZED)) 792 792 ret = sta_info_move_state_checked(sta, 793 793 IEEE80211_STA_AUTHORIZED); 794 - else 794 + else if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) 795 795 ret = sta_info_move_state_checked(sta, 796 796 IEEE80211_STA_ASSOC); 797 797 if (ret)