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 BC8E7440A25; Mon, 17 Aug 2026 15:28:01 +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=1786980482; cv=none; b=RtaR86MYCJTxT+6+JY1K6tNJBJO06GN6TsgGDVTNvEUyNo8q6UrXIVgiGo9C+gJQRpkL4KjSvpj2+gxJ2mQU93Wtkf/Td23KiwaCk0f3k57soSwH9TY/3p568MkBz83IB++hWcN5/YmSZmM493WUBo2gHlr6vALymCGCRjSsWMI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786980482; c=relaxed/simple; bh=91iFFQ4Btm7I+rXRW47z4hAkF5kcGuPfDhebZD3yj5Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iE+X7jSFT0fpqzrn926FvXh1tAyYJnyhONRqksg7wFbRIbak7bBS4Km84HmtnD/nHNRFmdZX6v0dB8DbYVQNS8XbWZAPYizb0eW+o+3BxxVqj7RF/FDG1wyU/p2gxLQ2rBaJQm5YN8OLbygxZ/bMN4/nrSGbpf47KICGUQp3HN8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fBNza9ts; 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="fBNza9ts" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 226461F00A3A; Mon, 17 Aug 2026 15:28:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1786980481; bh=R5Bc5xzU1UM3KlPsSQsStGCwfNN1IGSQBUmUJaARI3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fBNza9tsEvDmj5c3lizQFL3nUUuxbmxJP/kYH5kQgKKT2I/br5/YmX+9c496ytiJu ZXE7nJnPSllew/2Ze91WM/C/1x+2A21q8Y4aIu8p3PC38a/n8g1LBUbF/IWWwQ03iI vkhlBMANhbgB2BlILFNZRYyd2hwfV3goOUpahBFk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Muhammad Bilal Subject: [PATCH 6.1 571/609] staging: rtl8723bs: fix OOB read in WMM_param_handler() Date: Mon, 17 Aug 2026 15:34:27 +0200 Message-ID: <20260817132602.828908897@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260817132543.039278408@linuxfoundation.org> References: <20260817132543.039278408@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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Muhammad Bilal commit ae21407350151bddfd4fea7aa39bd0643c0ca9d3 upstream. WMM_param_handler() copies a fixed-size WMM parameter element out of a received information element without checking that the element is long enough, causing an out-of-bounds read for a short WMM IE. The handler reads sizeof(struct WMM_para_element) (18) bytes at pIE->data + 6, so it requires pIE->length to be at least 24 (WLAN_WMM_LEN), but it never validates the length. Two of its three callers reach it after matching only the WMM OUI: OnAssocRsp() in rtw_mlme_ext.c matches a 6-byte OUI, and join_cmd_hdl() matches a 4-byte OUI, before calling the handler. A vendor-specific IE carrying the WMM OUI but a length between 6 and 23, placed in an association response or in the IE blob handed to join_cmd_hdl(), passes the OUI check and then makes the memcmp() and memcpy() at pIE->data + 6 read past the end of the element. OnAssocRsp() parses a frame received from the AP, so this is reachable from a remote peer. The remaining caller in rtw_wlan_util.c already guards the handler with "pIE->length == WLAN_WMM_LEN". Move the equivalent check into the handler itself so every caller is covered; the sibling IE handlers in the same parsing loop (HT_caps_handler(), HT_info_handler(), ERP_IE_handler()) likewise bound their accesses by pIE->length. Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver") Cc: stable@vger.kernel.org Signed-off-by: Muhammad Bilal Link: https://patch.msgid.link/20260719041509.97894-1-meatuni001@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c @@ -731,6 +731,9 @@ int WMM_param_handler(struct adapter *pa return false; } + if (pIE->length != WLAN_WMM_LEN) + return false; + if (!memcmp(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element))) return false; else