From: Chaitanya Tata If an AP's UHR Capabilities or UHR Operation element fails the size checks in the element parser, elems->uhr_cap or elems->uhr_operation is left NULL and ieee80211_determine_ap_chan() falls back to EHT without saying why. The only trace is the "determined AP ... to be EHT" debug message, so a UHR connection quietly becomes an EHT one. This happens in practice when the AP and the client implement different 802.11bn drafts. Since the update to D1.5 the DBE Capability Parameters field is three octets, so this kernel drops the UHR Capabilities element of a hostapd built for D1.4, which sends one octet. The client then associates as EHT, or, if the AP requires UHR through its BSS membership selector, fails to associate with nothing in the log pointing at the UHR element. Print a message when UHR is dropped because the UHR Capabilities element is missing or invalid, and when the AP included UHR elements but its UHR Operation element was rejected, like the existing "drop UHR" messages for other invalid UHR information. Signed-off-by: Chaitanya Tata --- net/mac80211/mlme.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 4ea214e25056..9a7cade8076f 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -272,8 +272,11 @@ ieee80211_determine_ap_chan_uhr(struct ieee80211_sub_if_data *sdata, } /* frames other than beacons carry UHR capability too */ - if (!beacon && !elems->uhr_cap) + if (!beacon && !elems->uhr_cap) { + sdata_info(sdata, + "AP UHR capabilities missing or invalid, drop UHR\n"); return false; + } uhr_cap = ieee80211_get_uhr_iftype_cap_vif(sband, &sdata->vif); /* can't happen since we must have UHR to parse the elems */ @@ -608,8 +611,16 @@ ieee80211_determine_ap_chan(struct ieee80211_sub_if_data *sdata, } check_uhr: - if (conn->mode < IEEE80211_CONN_MODE_UHR || !uhr_oper || !elems->ml_basic) + if (conn->mode < IEEE80211_CONN_MODE_UHR || !elems->ml_basic) + return IEEE80211_CONN_MODE_EHT; + + if (!uhr_oper) { + /* the AP did include UHR elements, but they were invalid */ + if (elems->unrestricted_ap_mode >= IEEE80211_CONN_MODE_UHR) + sdata_info(sdata, + "AP UHR operation missing or invalid, drop UHR\n"); return IEEE80211_CONN_MODE_EHT; + } /* if UHR parameter update is invalid, ignore UHR entirely */ if (elems->parse_error & IEEE80211_PARSE_ERR_INVALID_UHR_PARAM_UPD) { -- 2.43.0