1
0
Fork 0

staging: rtl8723bs: Prevent an underflow in rtw_check_beacon_data().

commit 920c924488 upstream.

Dan Carpenter reported an integer underflow issue in the rtl8188eu driver.
This is also needed for the length (signed integer) in rtl8723bs, as it is
later converted to an unsigned integer and used in a memcpy operation.

Original issue is at https://patchwork.kernel.org/patch/9796371/

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Murray McAllister <murray.mcallister@insomniasec.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
pull/10/head
Murray McAllister 2018-07-02 13:07:28 +12:00 committed by Greg Kroah-Hartman
parent 908bfe10dd
commit e5bb39faed
1 changed files with 1 additions and 1 deletions

View File

@ -1059,7 +1059,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
return _FAIL;
if (len > MAX_IE_SZ)
if (len < 0 || len > MAX_IE_SZ)
return _FAIL;
pbss_network->IELength = len;