staging: rtl8188eu: fix potential memory corruption in rtw_check_beacon_data()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 5 Mar 2021 08:56:32 +0000 (11:56 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Mar 2021 16:06:31 +0000 (17:06 +0100)
commitbe9745304e3e00a2e94dc7221523c25d3a736702
treed8d7706bff6047e803a211a7ae002d1f51f0985a
parent550c9e49eb429cdb0c1e70ba6a6cf5935612f0dd
staging: rtl8188eu: fix potential memory corruption in rtw_check_beacon_data()

commit d4ac640322b06095128a5c45ba4a1e80929fe7f3 upstream.

The "ie_len" is a value in the 1-255 range that comes from the user.  We
have to cap it to ensure that it's not too large or it could lead to
memory corruption.

Fixes: 9a7fe54ddc3a ("staging: r8188eu: Add source files for new driver - part 1")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/YEHyQCrFZKTXyT7J@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_ap.c