linux/drivers/staging/rtl8723bs
Moksh Panicker 0e95ff792a staging: rtl8723bs: fix OOB reads in rtw_get_wps_ie()
rtw_get_wps_ie() iterates over IE data from network frames without
validating that the IE header and payload fit within the remaining
buffer before reading them. Specifically:

- in_ie[cnt + 1] is read without checking cnt + 1 < in_len
- memcmp(&in_ie[cnt + 2], ...) accesses cnt + 2 without bounds check
- in_ie[cnt + 1] is used as length without verifying payload fits

Add bounds checks at the top of the loop body to break early if fewer
than 2 bytes remain for the IE header, or if the declared payload
extends past the end of the buffer. Also require at least 4 bytes of
payload before comparing the WPS OUI.

Fixes: 554c0a3abf ("staging: Add rtl8723bs sdio wifi driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Moksh Panicker <mokshpanicker.7@gmail.com>
Link: https://patch.msgid.link/20260625202911.26782-1-mokshpanicker.7@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-07-17 14:23:13 +02:00
..
core staging: rtl8723bs: fix OOB reads in rtw_get_wps_ie() 2026-07-17 14:23:13 +02:00
hal staging: rtl8723bs: delete superfluous switch statement 2026-05-21 12:41:29 +02:00
include staging: rtl8723bs: propagate errno through hal xmit path 2026-05-21 12:39:51 +02:00
os_dep staging: rtl8723bs: fix inverted HT40 secondary channel offset 2026-07-17 14:22:34 +02: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