Procházet zdrojové kódy

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 před 7 roky
rodič
revize
5fdc34704f
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  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",