浏览代码

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
jitiphil 7 年之前
父节点
当前提交
5fdc34704f
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      core/cds/src/cds_sched.c

+ 2 - 1
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",