linux/drivers/staging
Navaneeth K 9829c6e1b2 staging: rtl8723bs: fix out-of-bounds read in rtw_get_ie() parser
[ Upstream commit 154828bf95 ]

The Information Element (IE) parser rtw_get_ie() trusted the length
byte of each IE without validating that the IE body (len bytes after
the 2-byte header) fits inside the remaining frame buffer. A malformed
frame can advertise an IE length larger than the available data, causing
the parser to increment its pointer beyond the buffer end. This results
in out-of-bounds reads or, depending on the pattern, an infinite loop.

Fix by validating that (offset + 2 + len) does not exceed the limit
before accepting the IE or advancing to the next element.

This prevents OOB reads and ensures the parser terminates safely on
malformed frames.

[ The context change is due to the commit 4610e57a7d
("staging: rtl8723bs: Remove redundant else branches.") in v5.19
which is irrelevant to the logic of this patch. ]

Signed-off-by: Navaneeth K <knavaneeth786@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johnny Hao <johnny_haocn@sina.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-04-18 10:33:35 +02:00
..
android staging: android: ashmem: add size field in procfs fdinfo 2021-06-18 13:02:40 +02:00
axis-fifo staging: axis-fifo: flush RX FIFO on read errors 2025-10-19 16:21:28 +02:00
board staging: board: Fix uninitialized spinlock when attaching genpd 2021-07-21 11:22:15 +02:00
clocking-wizard clk: clocking-wizard: Fix Oops in clk_wzrd_register_divider() 2023-07-23 13:47:07 +02:00
emxx_udc staging: emxx_udc: Add checks for dma_alloc_coherent() 2023-03-11 13:57:34 +01:00
fbtft staging: fbtft: core: fix potential memory leak in fbtft_probe_common() 2026-01-19 13:09:32 +01:00
fieldbus staging: fieldbus: Fix the error handling path in anybuss_host_common_probe() 2022-06-14 18:36:04 +02:00
fwserial tty: drop put_tty_driver 2021-07-27 12:17:21 +02:00
gdm724x net: vlan: introduce skb_vlan_eth_hdr() 2023-12-20 15:17:35 +01:00
greybus staging: greybus: lights: avoid NULL deref 2026-03-04 07:19:46 -05:00
gs_fpgaboot staging: fpgaboot: change FPGA indirect article to an 2021-06-09 14:26:54 +02:00
iio iio: adc: ad7280a: handle spi_setup() errors in probe() 2026-02-06 16:41:54 +01:00
ks7010 staging: ks7010: disable bh on tx_dev_lock 2024-09-04 13:23:22 +02:00
media media: verisilicon: Protect G2 HEVC decoder against invalid DPB index 2026-01-19 13:10:09 +01:00
most staging: most: dim2: use device release method 2021-12-17 10:30:16 +01:00
mt7621-dma staging/mt7621-dma: mtk-hsdma.c->hsdma-mt7621.c 2021-01-31 13:39:53 +01:00
mt7621-dts staging: mt7621-dts: change palmbus address to lower case 2023-03-03 11:45:53 +01:00
mt7621-pci PCI: mt7621: Add sentinel to quirks table 2022-12-31 13:14:26 +01:00
netlogic drivers: staging: netlogic: fix unmet dependency for PHYLIB 2021-03-26 15:06:15 +01:00
nvec staging: nvec: Fix incorrect null termination of battery manufacturer 2025-08-28 16:24:07 +02:00
octeon dev_ioctl: split out ndo_eth_ioctl 2021-07-27 20:11:45 +01:00
octeon-usb staging: octeon-hcd: Directly include linux/of.h 2021-06-10 13:09:15 +01:00
olpc_dcon kernel.h: split out panic and oops helpers 2021-07-01 11:06:04 -07:00
pi433 staging: pi433: break long lines 2020-09-04 15:39:07 +02:00
qlge IIO / Staging driver update for 5.15-rc1 2021-09-01 09:45:57 -07:00
r8188eu staging: r8188eu: Add Rosewill USB-N150 Nano to device tables 2022-09-28 11:11:38 +02:00
ralink-gdma staging: ralink-gdma: Remove incorrect author information 2021-06-09 12:07:52 +02:00
rtl8192e Revert "staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE" 2023-06-14 11:13:10 +02:00
rtl8192u staging: rtl8192u: Fix use after free in ieee80211_rx() 2022-12-31 13:14:30 +01:00
rtl8723bs staging: rtl8723bs: fix out-of-bounds read in rtw_get_ie() parser 2026-04-18 10:33:35 +02:00
rts5208 staging: rts5208: Fix get_ms_information() heap buffer size 2021-08-18 10:10:49 +02:00
sm750fb staging: sm750fb: Rename vScreen to v_screen in lynxfb_crtc 2021-07-28 20:17:26 +02:00
unisys staging: unisys: visorhba: Convert module from IDR to XArray 2021-06-15 13:55:11 +02:00
vc04_services staging: vc04_services: fix information leak in create_component() 2024-04-10 16:19:32 +02:00
vme Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2021-02-27 08:07:12 -08:00
vt6655 staging: vt6655: fix potential memory leak 2022-10-26 12:35:47 +02:00
vt6656 staging: vt6656: Remove filenames in files 2021-08-28 08:33:33 +02:00
wfx wifi: wfx: Fix error handling in wfx_core_init() 2024-12-14 19:50:56 +01:00
wlan-ng timers: Get rid of del_singleshot_timer_sync() 2026-02-11 13:35:27 +01:00
Kconfig staging: rtl8712: Remove driver using deprecated API wext 2025-12-07 06:09:36 +09:00
Makefile staging: rtl8712: Remove driver using deprecated API wext 2025-12-07 06:09:36 +09:00