]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mac80211: validate HE 6 GHz operation when EHT is used
authorJohannes Berg <johannes.berg@intel.com>
Tue, 3 Mar 2026 14:08:33 +0000 (15:08 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 13 Mar 2026 06:10:57 +0000 (07:10 +0100)
When in strict mode, validate that the HE 6 GHz operation is
valid even when EHT operation is used instead. This checks
that APs are advertising correct information for HE clients,
without testing with such clients.

Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260303150832.74b934163b99.If4d1db3f39c37900cf0d0f4669cd5f8b677daaa0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/mlme.c

index 5ecd3d1b172df70c6e447351c89f956b6d873c20..479bb76ec114321cd9bbb5c44bb71f95bba797de 100644 (file)
@@ -216,6 +216,24 @@ ieee80211_determine_ap_chan(struct ieee80211_sub_if_data *sdata,
                        return IEEE80211_CONN_MODE_LEGACY;
                }
 
+               if (eht_oper && ieee80211_hw_check(&sdata->local->hw, STRICT)) {
+                       struct cfg80211_chan_def he_chandef = *chandef;
+
+                       if (!ieee80211_chandef_he_6ghz_oper(sdata->local,
+                                                           he_oper, NULL,
+                                                           &he_chandef)) {
+                               sdata_info(sdata,
+                                          "bad HE operation in EHT AP\n");
+                               return IEEE80211_CONN_MODE_LEGACY;
+                       }
+
+                       if (!cfg80211_chandef_compatible(chandef,
+                                                        &he_chandef)) {
+                               sdata_info(sdata, "HE/EHT incompatible\n");
+                               return IEEE80211_CONN_MODE_LEGACY;
+                       }
+               }
+
                if (mode <= IEEE80211_CONN_MODE_EHT)
                        return mode;
                goto check_uhr;