linux/drivers/staging
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>
2026-07-17 14:23:13 +02:00
..
axis-fifo staging: axis-fifo: refactor device tree parsing 2026-02-23 15:45:31 +01:00
fbtft staging: fbtft: remove unused function fbtft_write_gpio16_wr_latched 2026-05-04 16:49:10 +02:00
greybus Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
iio Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
media [GIT PULL for v7.2] media updates 2026-06-18 17:21:54 -07:00
most staging: most: video: avoid double free on video register failure 2026-05-21 12:42:38 +02:00
nvec staging: nvec: fix unconditional pm_power_off teardown 2026-05-04 16:17:10 +02:00
octeon staging: octeon: replace pr_warn with dev_warn in fill and rx paths 2026-05-21 11:20:45 +02:00
rtl8723bs staging: rtl8723bs: fix OOB reads in rtw_get_wps_ie() 2026-07-17 14:23:13 +02:00
sm750fb staging: sm750: rename CamelCase variable Bpp to bpp 2026-05-21 12:41:39 +02:00
vc04_services Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vme_user staging: vme_user: fix location monitor leak in tsi148 bridge 2026-07-07 13:41:56 +02:00
Kconfig staging: gpib: Destage gpib 2025-11-24 17:52:11 +01:00
Makefile staging: gpib: Destage gpib 2025-11-24 17:52:11 +01:00