summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjitiphil <jitiphil@codeaurora.org>2018-04-05 16:18:22 +0530
committernshrivas <nshrivas@codeaurora.org>2018-04-06 01:56:10 -0700
commit87eb0566860a3f12aff421d550bb42aacf07454d (patch)
treec6166668c9f574096ecc5d560b3b1c30956be672
parentf41fea0c0a189df51dd902baf6a68154d38c7d3e (diff)
qcacld-3.0: Prevent access to rx thread after thread shutdown
During unload/SSR, the ol_rx_thread is shutdown and then the cpu hotplug notifier is unregistered. In other context cpu hotplug notifier could be accessing the freed contents of rxthread resulting in use after free. To avoid this race condition, reject the cpu hot plug notificaiton in case of a driver SSR in addition to load/unload. Change-Id: Iafadff92d5660b979c6cf20a70eef42d22a9e51a CRs-Fixed: 2219011
-rw-r--r--core/cds/src/cds_sched.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/cds/src/cds_sched.c b/core/cds/src/cds_sched.c
index 221251ef625c..5b9a8d765a6a 100644
--- a/core/cds/src/cds_sched.c
+++ b/core/cds/src/cds_sched.c
@@ -358,7 +358,8 @@ __cds_cpu_hotplug_notify(struct notifier_block *block,
if ((NULL == pSchedContext) || (NULL == pSchedContext->ol_rx_thread))
return NOTIFY_OK;
- if (cds_is_load_or_unload_in_progress())
+ if (cds_is_load_or_unload_in_progress() ||
+ cds_is_module_stop_in_progress() || cds_is_driver_recovering())
return NOTIFY_OK;
num_cpus = num_possible_cpus();