6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tristan Madani [ Upstream commit 6c17c57d45ef1652d80f79a9834597b25412fd26 ] __rtw89_wow_parse_akm() computes a pointer to the IE area from an association request frame: ies = mgmt->u.assoc_req.variable; but then passes skb->len as the IE data length to cfg80211_find_ie(). Since skb->len covers the entire frame including the 28-byte management header and fixed fields, cfg80211_find_ie() may read past the end of the actual IE data. Fix by computing the correct IE data length as skb->len minus the header offset, and validating the minimum frame length before parsing. Fixes: 92790c4e50d2 ("wifi: rtw89: wow: parsing Auth Key Management from associate request") Cc: stable@vger.kernel.org Signed-off-by: Tristan Madani Acked-by: Ping-Ke Shih Signed-off-by: Ping-Ke Shih Link: https://patch.msgid.link/20261007161721.261452-3-tristmd@gmail.com Signed-off-by: Sasha Levin --- drivers/net/wireless/realtek/rtw89/wow.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw89/wow.c b/drivers/net/wireless/realtek/rtw89/wow.c index 38181035ef8ea..dcc7a542efa94 100644 --- a/drivers/net/wireless/realtek/rtw89/wow.c +++ b/drivers/net/wireless/realtek/rtw89/wow.c @@ -16,10 +16,14 @@ void rtw89_wow_parse_akm(struct rtw89_dev *rtwdev, struct sk_buff *skb) { struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data; struct rtw89_wow_param *rtw_wow = &rtwdev->wow; + size_t hdr_len = offsetof(struct ieee80211_mgmt, u.assoc_req.variable); const u8 *rsn, *ies = mgmt->u.assoc_req.variable; struct rtw89_rsn_ie *rsn_ie; - rsn = cfg80211_find_ie(WLAN_EID_RSN, ies, skb->len); + if (skb->len < hdr_len) + return; + + rsn = cfg80211_find_ie(WLAN_EID_RSN, ies, skb->len - hdr_len); if (!rsn) return; -- 2.53.0