summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManjeet Singh <c_manjee@qti.qualcomm.com>2016-07-26 11:28:20 +0530
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-08-04 15:36:53 +0530
commit8eb13522344ef6aa466c91ca388df204fe410d67 (patch)
tree2e84964ed61897f574482550de71b7daf34db30b
parent32814c83a95f7dc599b4476421b081b0fb5d9c1c (diff)
qcacld-2.0: Validate adapter magic during bus bandwidth check
hdd_bus_bw_compute_cbk function is responsible for computing bus bandwidth by checking TX/RX stats per HDD adapter after taking them from adapter list. However, it's scheduled on a global timer so the following scenario can arise: 1)At time of scheduling, HDD adapter is valid and is passed. 2)During TX/RX stats check, HDD adapter is freed as a result of interface down. 3)Null hddCtx from adapter is accessed as a result and kernel panic occurs. Thus,validate adapter magic before accessing the hddCtx stored in adapter. Change-Id: If076e122db0538d01140e16305f046e68a86212a CRs-fixed: 1045004
-rwxr-xr-xCORE/HDD/src/wlan_hdd_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 8bcb0ac5a87f..3d5b9c9113e4 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -13752,6 +13752,9 @@ static void hdd_bus_bw_compute_cbk(void *priv)
if ((pAdapter = pAdapterNode->pAdapter) == NULL)
continue;
+ /* Validate magic so we don't end up accessing a freed adapter.*/
+ if (pAdapter->magic != WLAN_HDD_ADAPTER_MAGIC)
+ continue;
#ifdef IPA_UC_OFFLOAD
if (NULL == pValidAdapter)