From bf00f82427a1be7c0a16280eebd9ea298bf78865 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Fri, 30 Nov 2018 20:29:09 +0530 Subject: [PATCH] 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 --- core/hdd/src/wlan_hdd_cfg80211.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 15ecc826b098..d94b22cecc3b 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/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++) {