소스 검색

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",