From 5fdc34704f9487f3eb7c0d61540009bb79d7fa29 Mon Sep 17 00:00:00 2001 From: jitiphil Date: Thu, 5 Apr 2018 16:52:52 +0530 Subject: [PATCH] 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 --- core/cds/src/cds_sched.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/cds/src/cds_sched.c b/core/cds/src/cds_sched.c index 926546b18cab..30316b833f3a 100644 --- a/core/cds/src/cds_sched.c +++ b/core/cds/src/cds_sched.c @@ -351,7 +351,8 @@ static void __cds_cpu_hotplug_notify(uint32_t cpu, bool cpu_up) if (!pSchedContext || !pSchedContext->ol_rx_thread) return; - 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; cds_debug("'%s' event on CPU %u (of %d); Currently affine to CPU %u",