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 .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
ap.c wifi: cfg80211: remove wdev mutex 2023-09-11 11:27:23 +02:00
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 wifi: cfg80211: use strscpy to replace strlcpy 2022-07-15 11:43:12 +02:00
ibss.c wifi: cfg80211: remove wdev mutex 2023-09-11 11:27:23 +02:00
Kconfig wifi: cfg80211/mac80211: remove dependency on non-existing option 2024-01-18 14:50:01 +01:00
lib80211_crypt_ccmp.c wifi: use struct_group to copy addresses 2022-09-03 16:40:06 +02:00
lib80211_crypt_tkip.c wifi: lib80211: remove unused variables iv32 and iv16 2023-09-13 12:33:58 +02:00
lib80211_crypt_wep.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
lib80211.c lib80211: Remove unused macro DRV_NAME 2020-09-18 11:53:00 +02:00
Makefile kbuild: use $(src) instead of $(srctree)/$(src) for source directory 2024-05-10 04:34:52 +09:00
mesh.c wifi: cfg80211: remove scan_width support 2023-09-13 11:10:50 +02:00
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 wifi: cfg80211: remove wdev mutex 2023-09-11 11:27:23 +02:00
of.c
pmsr.c wifi: cfg80211: pmsr: use correct nla_get_uX functions 2024-05-29 15:23:54 +02:00
radiotap.c mac80211: Use flex-array for radiotap header bitmap 2021-08-13 09:58:25 +02:00
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 wifi: cfg80211: wext: convert return value to kernel-doc 2023-10-23 11:45:17 +02:00
wext-compat.h wifi: cfg80211: Avoid clashing function prototypes 2022-11-16 11:31:47 +02:00
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 wifi: cfg80211: remove wdev mutex 2023-09-11 11:27:23 +02:00
wext-spy.c wireless: wext-spy: Fix out-of-bounds warning 2021-06-23 10:57:17 +02:00