]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: cfg80211: adjust allocation of colocated AP data
authorDmitry Antipov <dmantipov@yandex.ru>
Mon, 13 Jan 2025 15:54:17 +0000 (18:54 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 15 Jan 2025 13:42:14 +0000 (14:42 +0100)
In 'cfg80211_scan_6ghz()', an instances of 'struct cfg80211_colocated_ap'
are allocated as if they would have 'ssid' as trailing VLA member. Since
this is not so, extra IEEE80211_MAX_SSID_LEN bytes are not needed.
Briefly tested with KUnit.

Fixes: c8cb5b854b40 ("nl80211/cfg80211: support 6 GHz scanning")
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Link: https://patch.msgid.link/20250113155417.552587-1-dmantipov@yandex.ru
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/scan.c

index bc77cfede492f8fedd145c86d02e507f4b189d79..cd2124329521005d7048b1e89dd824574007464f 100644 (file)
@@ -893,9 +893,7 @@ static int cfg80211_scan_6ghz(struct cfg80211_registered_device *rdev)
                        if (ret)
                                continue;
 
-                       entry = kzalloc(sizeof(*entry) + IEEE80211_MAX_SSID_LEN,
-                                       GFP_ATOMIC);
-
+                       entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
                        if (!entry)
                                continue;