]> git.baikalelectronics.ru Git - kernel.git/commit
staging: rtl8723bs: add missing range check on id
authorColin Ian King <colin.king@canonical.com>
Wed, 20 Sep 2017 21:19:57 +0000 (22:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Sep 2017 09:00:58 +0000 (11:00 +0200)
commit500ac98483310baee1ac6a0a1944ecff2d03ba71
tree1f24446f549071232c8151053f785e148fe8eee9
parent6ec6e2166ef69e954aae9cc590227536a7f640f8
staging: rtl8723bs: add missing range check on id

The value of the u8 id needs to be upper bounds checked to ensure
the cam_cache array on the adapter dvobj is not indexed outside
of the allowed range of 0..TOTAL_CAM_ENTRY-1. This can currently
occur if id is >= TOTAL_CAM_ENTRY when calling write_cam_from_cache.
Fix this by adding an upper range check.

Detected by CoverityScan, CID#1428464 ("Use of untrusted scalar value")

Fixes: 84ed90a855bc ("staging: Add rtl8723bs sdio wifi driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/os_dep/rtw_proc.c