Skip to contentSkip to conversation

Patch "brcmfmac: avoid potential stack overflow in brcmf_cfg80211_start_ap()" has been added to the 4.7-stable tree

PATCH [email protected] 1 participant 1 message Sep 22, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

brcmfmac: avoid potential stack overflow in brcmf_cfg80211_start_ap()

to the 4.7-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
brcmfmac-avoid-potential-stack-overflow-in-brcmf_cfg80211_start_ap.patch
and it can be found in the queue-4.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From ded89912156b1a47d940a0c954c43afbabd0c42c Mon Sep 17 00:00:00 2001

From: Arend Van Spriel <[email protected]>
Date: Mon, 5 Sep 2016 10:45:47 +0100
Subject: brcmfmac: avoid potential stack overflow in brcmf_cfg80211_start_ap()

From: Arend Van Spriel <[email protected]>

commit ded89912156b1a47d940a0c954c43afbabd0c42c upstream.

User-space can choose to omit NL80211_ATTR_SSID and only provide raw IE TLV data. When doing so it can provide SSID IE with length exceeding the allowed size. The driver further processes this IE copying it into a local variable without checking the length. Hence stack can be corrupted and used as exploit.

---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +1 -1
@@ -4467,7 +4467,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi
 				(u8 *)&settings->beacon.head[ie_offset],
 				settings->beacon.head_len - ie_offset,
 				WLAN_EID_SSID);
-		if (!ssid_ie)
+		if (!ssid_ie || ssid_ie->len > IEEE80211_MAX_SSID_LEN)
 			return -EINVAL;
 
 		memcpy(ssid_le.SSID, ssid_ie->data, ssid_ie->len);

Patches currently in stable-queue which might be from [email protected] are

queue-4.7/brcmfmac-avoid-potential-stack-overflow-in-brcmf_cfg80211_start_ap.patch