summaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2020-10-29 23:24:07 +0100
committerJohannes Berg <johannes.berg@intel.com>2020-11-06 10:02:24 +0100
commitba5c25236bc3d399df82ebe923490ea8d2d35cf2 (patch)
tree96b1703109e36c8625fdc22020eade9e03f39839 /net/wireless
parentcfg80211: Add support to calculate and report 4096-QAM HE rates (diff)
downloadlinux-ba5c25236bc3d399df82ebe923490ea8d2d35cf2.tar.xz
linux-ba5c25236bc3d399df82ebe923490ea8d2d35cf2.zip
nl80211/cfg80211: fix potential infinite loop
The for-loop iterates with a u8 loop counter and compares this with the loop upper limit of request->n_ssids which is an int type. There is a potential infinite loop if n_ssids is larger than the u8 loop counter, so fix this by making the loop counter an int. Addresses-Coverity: ("Infinite loop") Fixes: c8cb5b854b40 ("nl80211/cfg80211: support 6 GHz scanning") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20201029222407.390218-1-colin.king@canonical.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/scan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 8d0e49c46db3..3409f37d838b 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -694,7 +694,7 @@ static void cfg80211_scan_req_add_chan(struct cfg80211_scan_request *request,
static bool cfg80211_find_ssid_match(struct cfg80211_colocated_ap *ap,
struct cfg80211_scan_request *request)
{
- u8 i;
+ int i;
u32 s_ssid;
for (i = 0; i < request->n_ssids; i++) {