From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF10E415F15; Tue, 21 Jul 2026 20:17:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784665028; cv=none; b=i50tmWJnDHzV55/pIFU0kFWF2oGvJTJ4wfi/eBR8g3RZvZWzgIOYtBuqnuDexjg0/SVCx3jO9jYuvgMK7RAv0WCZXizrYl/OUELHgF+mVkjK6tiwV59y7sfuNdicB+hANoUr8BHwyTVtUI56ilfuBMMGHO2rB0AGwZS8u0w56ag= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784665028; c=relaxed/simple; bh=UfsZou2UrG2q/MQMhBEY5Y2yfLHfakBvXKrtaNKT3BU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Wt9cMaXZoRgYNZ+h0LHP1pMQVLsgmFx/P+t6fyGbifuiB6beHRRJRwFCNPsHFjS9n2w84OEEuuMhm5FA1pL423c6VsTdsOL5oQV9QcL55oZFjsiqmxk7AmtHRVgVvd2PD4pzNxV9sngBGWjELzVRplHT3RXNb4I8k2D+5YMdgSk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xOkVzWx3; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xOkVzWx3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40ECF1F00A3A; Tue, 21 Jul 2026 20:17:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784665026; bh=F3aTCvCGz17UDuSKiS3cdY8tM0SzVuLFtIpK8TeMR30=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=xOkVzWx3uE9ylSevVgKkXCbqsfEua+LQFUb02sn47maofjieIfFCXWwMUHwkO8OLU 3Sofq2/sxdeTUI3/OG4b57HTJyOlEOZAdymM4qsGI2myGvZjiW+kEjabkWBJOUS3Dm qTDYQszlg/r7HU5u8RGAIcz7MFZAM79762JeRO+g= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Luka Gejak , Alexandru Hossu Subject: [PATCH 6.6 0150/1266] staging: rtl8723bs: fix OOB reads in IE loops in issue_assocreq() and join_cmd_hdl() Date: Tue, 21 Jul 2026 17:09:47 +0200 Message-ID: <20260721152445.163288581@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152441.786066624@linuxfoundation.org> References: <20260721152441.786066624@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexandru Hossu commit ef61d628dfad38fead1fd2e08979ae9126d011d5 upstream. Two IE parsing loops are missing the header bounds checks before they dereference pIE->length: - issue_assocreq() walks pmlmeinfo->network.ies to build the association request. If the stored IE data ends with only an element_id byte and no length byte, pIE->length is read one byte past the end of the buffer. - join_cmd_hdl() walks pnetwork->ies during station join and has the same problem under the same conditions. Both buffers are filled from AP beacon and probe-response frames, so a malicious AP that sends a truncated final IE can trigger the issue. Apply the two-guard pattern established in update_beacon_info(): 1. Break if fewer than sizeof(*pIE) bytes remain. 2. Break if the IE's declared data extends past the buffer end. Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver") Cc: stable Reviewed-by: Luka Gejak Signed-off-by: Alexandru Hossu Link: https://patch.msgid.link/20260522004531.1038924-3-hossu.alexandru@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -2966,7 +2966,11 @@ void issue_assocreq(struct adapter *pada /* vendor specific IE, such as WPA, WMM, WPS */ for (i = sizeof(struct ndis_802_11_fix_ie); i < pmlmeinfo->network.ie_length;) { + if (i + sizeof(*pIE) > pmlmeinfo->network.ie_length) + break; pIE = (struct ndis_80211_var_ie *)(pmlmeinfo->network.ies + i); + if (i + sizeof(*pIE) + pIE->length > pmlmeinfo->network.ie_length) + break; switch (pIE->element_id) { case WLAN_EID_VENDOR_SPECIFIC: @@ -5371,7 +5375,11 @@ u8 join_cmd_hdl(struct adapter *padapter /* sizeof(struct ndis_802_11_fix_ie) */ for (i = _FIXED_IE_LENGTH_; i < pnetwork->ie_length;) { + if (i + sizeof(*pIE) > pnetwork->ie_length) + break; pIE = (struct ndis_80211_var_ie *)(pnetwork->ies + i); + if (i + sizeof(*pIE) + pIE->length > pnetwork->ie_length) + break; switch (pIE->element_id) { case WLAN_EID_VENDOR_SPECIFIC:/* Get WMM IE. */