Details
-
Bug
-
Resolution: Cannot Reproduce
-
Minor
-
None
-
None
-
None
-
3
-
9223372036854775807
Description
The checking and assgin below could be racy:
if (lu_env_percpu[i].lep_task == current) { env = lu_env_percpu[i].lep_env; CPU0 thread0 lu_env_percpu[i].lep_task == current thread1 switch into CPU0 changes lu_env_percpu[0] thread0 switch back CPU0,return lu_env_percpu[0].lep_env;
The problem is access and change per_cpu variable here
shall be atomic, since it is per cpu variable, we should
take care it not been preempted.