]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
nl80211: limit band information in non-split data
authorJohannes Berg <johannes.berg@intel.com>
Mon, 12 Jul 2021 19:53:30 +0000 (21:53 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 23 Jul 2021 08:35:15 +0000 (10:35 +0200)
In non-split data, we shouldn't be adding S1G and 6 GHz
data (or future bands) since we're really close to the
4k message size limit. Remove those bands, any modern
userspace that can use S1G or 6 GHz should already be
using split dumps, and if not then it needs to update.

Link: https://lore.kernel.org/r/20210712215329.31444162a2c2.I5555312e4a074c84f8b4e7ad79dc4d1fbfc5126c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c

index 50eb405b0690e612e68aafdfaee538000a076948..16c88beea48b8ed5b90460c76b8c217f11852d0d 100644 (file)
@@ -2351,7 +2351,10 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *rdev,
                        goto nla_put_failure;
 
                for (band = state->band_start;
-                    band < NUM_NL80211_BANDS; band++) {
+                    band < (state->split ?
+                               NUM_NL80211_BANDS :
+                               NL80211_BAND_60GHZ + 1);
+                    band++) {
                        struct ieee80211_supported_band *sband;
 
                        /* omit higher bands for ancient software */