Prechádzať zdrojové kódy

qcacld-3.0: Validate all channels for avoid_freq channel list

In avoid frequency vendor command, only data validation is
being done but each individual channel is not getting validated
which may lead to an array out of bound access as the array
which is used to cache the channels has the size of valid number
of channels.

To avoid this, add a check to validate each channel before
updating the unsafe channel list array.

Change-ID: I433e9297207869e43d1a6ee2d621bded2f562656
CRs-Fixed: 2341890
Ashish Kumar Dhanotiya 6 rokov pred
rodič
commit
bf00f82427
1 zmenil súbory, kde vykonal 2 pridanie a 0 odobranie
  1. 2 0
      core/hdd/src/wlan_hdd_cfg80211.c

+ 2 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -8431,6 +8431,8 @@ static int hdd_validate_avoid_freq_chanlist(
 		     ch_idx <= channel_list->
 					avoid_freq_range[range_idx].end_freq;
 		     ch_idx++) {
+			 if (INVALID_CHANNEL == reg_get_chan_enum(ch_idx))
+				continue;
 			for (unsafe_channel_index = 0;
 			     unsafe_channel_index < unsafe_channel_count;
 			     unsafe_channel_index++) {