提交 ba5c2523 编写于 作者: C Colin Ian King 提交者: Johannes Berg

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: c8cb5b85 ("nl80211/cfg80211: support 6 GHz scanning")
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20201029222407.390218-1-colin.king@canonical.comSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 9c97c88d
...@@ -694,7 +694,7 @@ static void cfg80211_scan_req_add_chan(struct cfg80211_scan_request *request, ...@@ -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, static bool cfg80211_find_ssid_match(struct cfg80211_colocated_ap *ap,
struct cfg80211_scan_request *request) struct cfg80211_scan_request *request)
{ {
u8 i; int i;
u32 s_ssid; u32 s_ssid;
for (i = 0; i < request->n_ssids; i++) { for (i = 0; i < request->n_ssids; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册