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 16588364038; Sat, 12 Sep 2026 09:34:09 +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=1789205651; cv=none; b=qUMjAhmabBGFgD4ePzAQxB455ogj8FjcUyGstjmG8q/opF/0bxgJLJY11Byfp8LHMi+fMcy48XIcG4qEK/zuVjiLGX7lexBSWSMpFjFHK2FhkexACv9hg1acBvZXHjXTsmUB8dsKZIEkE1eIXaRgjl22ZY9iV6oM3dWjmISltS4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789205651; c=relaxed/simple; bh=MVU7iXxEFVyFOlARaUUlAg727n/Lko00y/ckJuuvfno=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q7GZoKIU4M0SoEIVV7AlwZPQYI8o62lG4phTq8a8jTCfaJDX2Jo/4eSsubsXlNPO3qE5bAYVSm2klOPun5st7XvwkotOKzOfCK54McTGHeMsRC3LyulG/TlZB31U3xJMpwiQaiX8woaiBVDxoN745Dj0UrsocXIZEPvYebuhU9w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=LzOgMOa0; 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="LzOgMOa0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48E931F000FF; Sat, 12 Sep 2026 09:34:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789205649; bh=17jagA5x8b0RQNgRyLCNmvL/kaaLrj0DjnYpshas5Ao=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LzOgMOa0iAOluHPYMRZFb7/t/6e2iThPT1mgfOZGUwxHQeCJ/CH4cy84KloLOl/Xy SIeSayXlNy+ZgvEdENzS1gvqx6C9reaoJUd9UrAUMW+RHPmBVXpZ9a7NQdKQHNvndg 3sz34XNDIsEDLbYpP6jQ5WDi+IP/4ZCfbv6khJgc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Muhammad Bilal , Sasha Levin Subject: [PATCH 6.18 0043/1518] staging: rtl8723bs: fix OOB read in rtw_restruct_wmm_ie() Date: Sat, 12 Sep 2026 08:36:52 +0200 Message-ID: <20260912065624.410222394@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065623.398859879@linuxfoundation.org> References: <20260912065623.398859879@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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Muhammad Bilal [ Upstream commit 28a289beaf226b30b1e6e7d7b1a2946fe2d6e852 ] rtw_restruct_wmm_ie() scans in_ie for a WMM IE with: while (i < in_len) { ... if (i + 5 < in_len && in_ie[i] == 0xDD && ...) { ... break; } i += (in_ie[i + 1] + 2); /* to the next IE element */ } When the "i + 5 < in_len" match check fails simply because i is within 5 bytes of the end of the buffer (i.e. no WMM IE was found near the tail of in_ie), execution falls through to "i += (in_ie[i + 1] + 2)", which reads in_ie[i + 1]. If i == in_len - 1 at that point, this is a 1-byte out-of-bounds read of an attacker-influenced IE buffer built from association/scan data. Commit a75281626fc8f ("staging: rtl8723bs: fix potential out-of-bounds read in rtw_restruct_wmm_ie") added the "i + 5 < in_len" guard to the match condition itself, but did not add an equivalent guard before the fallthrough advance, so the same class of OOB read remained reachable through the non-matching path. Add an explicit bounds check before advancing to the next IE. Fixes: 554c0a3abf216 ("staging: Add rtl8723bs sdio wifi driver") Cc: stable@vger.kernel.org Signed-off-by: Muhammad Bilal Link: https://patch.msgid.link/20260728125456.32359-4-meatuni001@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_mlme.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -2029,6 +2029,9 @@ int rtw_restruct_wmm_ie(struct adapter * break; } + if (i + 1 >= in_len) + break; + i += (in_ie[i + 1] + 2); /* to the next IE element */ }