linux/drivers/staging/rtl8723bs
Muhammad Bilal 28a289beaf staging: rtl8723bs: fix OOB read in rtw_restruct_wmm_ie()
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 a75281626f ("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: 554c0a3abf ("staging: Add rtl8723bs sdio wifi driver")
Cc: stable@vger.kernel.org
Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>
Link: https://patch.msgid.link/20260728125456.32359-4-meatuni001@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-09-01 12:15:16 +02:00
..
core staging: rtl8723bs: fix OOB read in rtw_restruct_wmm_ie() 2026-09-01 12:15:16 +02:00
hal staging: rtl8723bs: remove unused enumerations 2026-07-28 09:37:05 +02:00
include staging: rtl8723bs: add blank line after declaration 2026-07-28 09:37:17 +02:00
os_dep Staging driver updates for 7.3-rc1 2026-08-25 10:16:19 -07:00
Kconfig staging: rtl8723bs: select CRYPTO_LIB_UTILS instead of CRYPTO 2025-12-17 14:01:23 +01:00
Makefile staging: rtl8723bs: remove os_dep/recv_linux.c 2025-09-06 15:55:13 +02:00
TODO staging: rtl8723bs: remove stale TODO item regarding %pM 2026-02-07 14:44:24 +01:00