Skip to contentSkip to conversation

staging: rtl8723bs: fix remote heap information disclosure in issue_assocreq

PATCH Superseded [email protected] 2 participants 2 messages Apr 14 – Apr 15

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: fix remote heap information disclosure in issue_assocreq

From: Luka Gejak <[email protected]>

When building an association request frame, the driver copies the ht capability ie using the attacker-controlled pIE->length from the ap's beacon. If the ap provides a length greater than the size of struct HT_caps_element (26 bytes), it causes an out-of-bounds read of the adjacent heap memory (HT_info and network structures). This uninitialized or sensitive memory is then transmitted over the air, resulting in a remote heap information disclosure.

Fix this by clamping the length passed to rtw_set_ie() to the actual size of struct HT_caps_element.

Fixes 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")

---
Note: Note: Alignment of arguments in rtw_set_ie() is intentionally like that to avoid WARNING: line length of 105 exceeds 100 columns.

 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +3 -1
index 5f00fe282d1b..a5f30c3fd47e 100644
@@ -2954,7 +2954,9 @@ void issue_assocreq(struct adapter *padapter)
 			if (padapter->mlmepriv.htpriv.ht_option) {
 				if (!(is_ap_in_tkip(padapter))) {
 					memcpy(&(pmlmeinfo->HT_caps), pIE->data, sizeof(struct HT_caps_element));
-					pframe = rtw_set_ie(pframe, WLAN_EID_HT_CAPABILITY, pIE->length, (u8 *)(&(pmlmeinfo->HT_caps)), &(pattrib->pktlen));
+					pframe = rtw_set_ie(pframe, WLAN_EID_HT_CAPABILITY,
+					min_t(uint, pIE->length, sizeof(struct HT_caps_element)),
+					(u8 *)&pmlmeinfo->HT_caps, &pattrib->pktlen);
 				}
 			}
 			break;
Signature · 1 line
2.53.0
#1 lore raw
Quoted 13 lines · On Tue, Apr 14, 2026 at 09:49:45PM +0200, [email protected] wrote:

From: Luka Gejak <[email protected]>

When building an association request frame, the driver copies the ht capability ie using the attacker-controlled pIE->length from the ap's beacon. If the ap provides a length greater than the size of struct HT_caps_element (26 bytes), it causes an out-of-bounds read of the adjacent heap memory (HT_info and network structures). This uninitialized or sensitive memory is then transmitted over the air, resulting in a remote heap information disclosure.

Fix this by clamping the length passed to rtw_set_ie() to the actual size of struct HT_caps_element.

Quoted 6 lines
Fixes 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")

---
Note: Note: Alignment of arguments in rtw_set_ie() is intentionally like that to avoid WARNING: line length of 105 exceeds 100 columns.

That's not ok, please exceed the length.

thanks,

greg k-h