Skip to content

Commit a7b20f5

Browse files
Dan Carpentergregkh
authored andcommitted
wifi: cw1200: cap SSID length in cw1200_do_join()
[ Upstream commit f8f15f6 ] If the ssidie[1] length is more that 32 it leads to memory corruption. Fixes: a910e4a ("cw1200: add driver for the ST-E CW1100 & CW1200 WLAN chipsets") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/e91fb43fcedc4893b604dfb973131661510901a7.1756456951.git.dan.carpenter@linaro.org Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 8cfa0f0 commit a7b20f5

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/wireless/st/cw1200

1 file changed

+1
-1
lines changed

drivers/net/wireless/st/cw1200/sta.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ static void cw1200_do_join(struct cw1200_common *priv)
12901290
rcu_read_lock();
12911291
ssidie = ieee80211_bss_get_ie(bss, WLAN_EID_SSID);
12921292
if (ssidie) {
1293-
join.ssid_len = ssidie[1];
1293+
join.ssid_len = min(ssidie[1], IEEE80211_MAX_SSID_LEN);
12941294
memcpy(join.ssid, &ssidie[2], join.ssid_len);
12951295
}
12961296
rcu_read_unlock();

0 commit comments

Comments
 (0)