staging: wilc1000: fix illegal memory access in wilc_parse_join_bss_param()
authorAjay Singh <ajay.kathat@microchip.com>
Thu, 7 Nov 2019 15:58:54 +0000 (15:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Nov 2019 15:37:59 +0000 (16:37 +0100)
commitc7e621bb981b76d3bfd8a595070ee8282ac4a32b
tree4debf0dce4d23e2a1fc152af7c0f375e7dc0cfb1
parenta46e810975b8bde22e612c12331e1c5207797435
staging: wilc1000: fix illegal memory access in wilc_parse_join_bss_param()

Do not copy the extended supported rates in 'param->supp_rates' if the
array is already full with basic rates values. The array size check
helped to avoid possible illegal memory access [1] while copying to
'param->supp_rates' array.

1. https://marc.info/?l=linux-next&m=157301720517456&w=2

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1487400 ("Memory - illegal accesses")
Fixes: 4e0b0f42c9c7 ("staging: wilc1000: use struct to pack join parameters for FW")
Cc: stable@vger.kernel.org
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20191106062127.3165-1-ajay.kathat@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/hif.c