]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
staging: rtl8723bs: fix stack buffer overflow in OnAssocReq IE parsing
authorNavaneeth K <knavaneeth786@gmail.com>
Thu, 20 Nov 2025 16:33:08 +0000 (16:33 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Dec 2025 17:42:47 +0000 (18:42 +0100)
commite841d8ea722315b781c4fc5bf4f7670fbca88875
tree3a1b465c2c8abb42f564f41dbf0500f9a24e6734
parentc0d93d69e1472ba75b78898979b90a98ba2a2501
staging: rtl8723bs: fix stack buffer overflow in OnAssocReq IE parsing

commit 6ef0e1c10455927867cac8f0ed6b49f328f8cf95 upstream.

The Supported Rates IE length from an incoming Association Request frame
was used directly as the memcpy() length when copying into a fixed-size
16-byte stack buffer (supportRate). A malicious station can advertise an
IE length larger than 16 bytes, causing a stack buffer overflow.

Clamp ie_len to the buffer size before copying the Supported Rates IE,
and correct the bounds check when merging Extended Supported Rates to
prevent a second potential overflow.

This prevents kernel stack corruption triggered by malformed association
requests.

Signed-off-by: Navaneeth K <knavaneeth786@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c