Skip to content

Commit 963a185

Browse files
committed
mac80211: don't validate unchanged AP bandwidth while tracking
The MLME code in mac80211 must track whether or not the AP changed bandwidth, but if there's no change while tracking it shouldn't do anything, otherwise regulatory updates can make it impossible to connect to certain APs if the regulatory database doesn't match the information from the AP. See the precise scenario described in the code. This still leaves some possible problems with CSA or if the AP actually changed bandwidth, but those cases are less common and won't completely prevent using it. This fixes https://bugzilla.kernel.org/show_bug.cgi?id=70881 Cc: stable@vger.kernel.org Reported-and-tested-by: Nate Carlson <kernel@natecarlson.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent e3685e0 commit 963a185

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎net/mac80211/mlme.c‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,28 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata,
271271
ret = 0;
272272

273273
out:
274+
/*
275+
* When tracking the current AP, don't do any further checks if the
276+
* new chandef is identical to the one we're currently using for the
277+
* connection. This keeps us from playing ping-pong with regulatory,
278+
* without it the following can happen (for example):
279+
* - connect to an AP with 80 MHz, world regdom allows 80 MHz
280+
* - AP advertises regdom US
281+
* - CRDA loads regdom US with 80 MHz prohibited (old database)
282+
* - the code below detects an unsupported channel, downgrades, and
283+
* we disconnect from the AP in the caller
284+
* - disconnect causes CRDA to reload world regdomain and the game
285+
* starts anew.
286+
* (see https://bugzilla.kernel.org/show_bug.cgi?id=70881)
287+
*
288+
* It seems possible that there are still scenarios with CSA or real
289+
* bandwidth changes where a this could happen, but those cases are
290+
* less common and wouldn't completely prevent using the AP.
291+
*/
292+
if (tracking &&
293+
cfg80211_chandef_identical(chandef, &sdata->vif.bss_conf.chandef))
294+
return ret;
295+
274296
/* don't print the message below for VHT mismatch if VHT is disabled */
275297
if (ret & IEEE80211_STA_DISABLE_VHT)
276298
vht_chandef = *chandef;

0 commit comments

Comments
 (0)