Commit 3bf39f7
staging: rtl8723bs: fix OOB reads in is_ap_in_tkip() IE loop
The loop in is_ap_in_tkip() iterates over IEs without verifying that
enough bytes remain before dereferencing the IE header or its payload:
- pIE->element_id and pIE->length are read without checking that
i + sizeof(*pIE) <= ie_length, so a truncated IE at the end of the
buffer causes an OOB read.
- For WLAN_EID_VENDOR_SPECIFIC the code compares pIE->data + 12,
which requires pIE->length >= 16. For WLAN_EID_RSN it compares
pIE->data + 8, requiring pIE->length >= 12. Neither requirement
is checked.
Add the missing IE header and payload bounds checks and guard each
data access with an explicit pIE->length minimum, matching the
pattern established in update_beacon_info().
Fixes: 554c0a3 ("staging: Add rtl8723bs sdio wifi driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Alexandru Hossu <hossu.alexandru@gmail.com>
Link: https://patch.msgid.link/20260522004531.1038924-7-hossu.alexandru@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent f965420 commit 3bf39f7
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1308 | 1308 | | |
1309 | 1309 | | |
1310 | 1310 | | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
1311 | 1316 | | |
1312 | 1317 | | |
1313 | | - | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
1314 | 1321 | | |
1315 | 1322 | | |
1316 | 1323 | | |
1317 | 1324 | | |
1318 | 1325 | | |
1319 | | - | |
| 1326 | + | |
| 1327 | + | |
1320 | 1328 | | |
1321 | 1329 | | |
1322 | 1330 | | |
1323 | 1331 | | |
1324 | 1332 | | |
1325 | 1333 | | |
1326 | 1334 | | |
1327 | | - | |
| 1335 | + | |
1328 | 1336 | | |
1329 | 1337 | | |
1330 | 1338 | | |
| |||
0 commit comments