Search Linux Wireless

[PATCH v2] wifi: cfg80211: adjust allocation of colocated AP data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
v2: adjusted to apply on top of commit 295adaf455b
("wifi: mac80211: avoid double free in auth/assoc timeout")
---
 net/wireless/scan.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index bc77cfede492..d001272d88d1 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -893,8 +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;
-- 
2.47.1





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux