linux/net/wireless
Johannes Berg f7a8b10bfd wifi: cfg80211: fix 6 GHz scan request building
The 6 GHz scan request struct allocated by cfg80211_scan_6ghz() is
meant to be formed this way:

 [base struct][channels][ssids][6ghz_params]

It is allocated with [channels] as the maximum number of channels
supported by the driver in the 6 GHz band, since allocation is
before knowing how many there will be.

However, the inner pointers are set incorrectly: initially, the
6 GHz scan parameters pointer is set:

 [base struct][channels]
                        ^ scan_6ghz_params

and later the SSID pointer is set to the end of the actually
_used_ channels.

 [base struct][channels]
                  ^ ssids

If many APs were to be discovered, and many channels used, and
there were many SSIDs, then the SSIDs could overlap the 6 GHz
parameters.

Additionally, the request->ssids for most of the function points
to the original request still (given the struct copy) but is used
normally, which is confusing.

Clear this up, by actually using the allocated space for 6 GHz
parameters _after_ the SSIDs, and set up the SSIDs initially so
they are used more clearly. Just like in nl80211.c, set them
only if there actually are SSIDs though.

Finally, also copy the elements (ie/ie_len) so they're part of
the same request, not pointing to the old request.

Co-developed-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://msgid.link/20240510113738.4190692ef4ee.I0cb19188be17a8abd029805e3373c0a7777c214c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-05-29 15:25:25 +02:00
..
certs wifi: cfg80211: fix certs build to not depend on file order 2023-12-14 09:11:51 +01:00
tests wifi: cfg80211: allow cfg80211_defragment_element() without output 2024-03-04 14:33:51 +01:00
.gitignore
ap.c
chan.c wifi: cfg80211: optionally support monitor on disabled channels 2024-02-12 21:22:48 +01:00
core.c wifi: cfg80211: fully move wiphy work to unbound workqueue 2024-05-29 15:23:33 +02:00
core.h wifi: cfg80211: optionally support monitor on disabled channels 2024-02-12 21:22:48 +01:00
debugfs.c wifi: cfg80211: add locked debugfs wrappers 2023-11-27 11:24:58 +01:00
debugfs.h
ethtool.c
ibss.c
Kconfig wifi: cfg80211/mac80211: remove dependency on non-existing option 2024-01-18 14:50:01 +01:00
lib80211.c
lib80211_crypt_ccmp.c
lib80211_crypt_tkip.c
lib80211_crypt_wep.c
Makefile kbuild: use $(src) instead of $(srctree)/$(src) for source directory 2024-05-10 04:34:52 +09:00
mesh.c
mlme.c wifi: cfg80211: validate MLO connections better 2024-01-26 09:39:49 +01:00
nl80211.c Merge wireless into wireless-next 2024-05-06 16:32:51 +02:00
nl80211.h wifi: cfg80211: make RX assoc data const 2023-12-06 11:50:28 +01:00
ocb.c
of.c
pmsr.c wifi: cfg80211: pmsr: use correct nla_get_uX functions 2024-05-29 15:23:54 +02:00
radiotap.c
rdev-ops.h wifi: cfg80211: fix 6 GHz scan request building 2024-05-29 15:25:25 +02:00
reg.c wifi: cfg80211: make some regulatory functions void 2024-04-19 10:28:25 +02:00
reg.h wifi: cfg80211: add return docs for regulatory functions 2024-04-19 10:29:08 +02:00
scan.c wifi: cfg80211: fix 6 GHz scan request building 2024-05-29 15:25:25 +02:00
sme.c wifi: cfg80211: Clear mlo_links info when STA disconnects 2024-05-03 10:03:19 +02:00
sysfs.c wifi: cfg80211: fully move wiphy work to unbound workqueue 2024-05-29 15:23:33 +02:00
sysfs.h
trace.c
trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
util.c wifi: cfg80211: Lock wiphy in cfg80211_get_station 2024-05-29 15:23:41 +02:00
wext-compat.c
wext-compat.h
wext-core.c wifi: cfg80211: add a flag to disable wireless extensions 2024-03-25 15:23:06 +01:00
wext-priv.c
wext-proc.c
wext-sme.c
wext-spy.c