Skip to content

Commit

Permalink
cpuset: fix a race condition in __cpuset_node_allowed_softwall()
Browse files Browse the repository at this point in the history
It's not safe to access task's cpuset after releasing task_lock().
Holding callback_mutex won't help.

Cc: <[email protected]>
Signed-off-by: Li Zefan <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
  • Loading branch information
lizf-os authored and htejun committed Feb 27, 2014
1 parent 4729583 commit 99afb0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -2482,9 +2482,9 @@ int __cpuset_node_allowed_softwall(int node, gfp_t gfp_mask)

task_lock(current);
cs = nearest_hardwall_ancestor(task_cs(current));
allowed = node_isset(node, cs->mems_allowed);
task_unlock(current);

allowed = node_isset(node, cs->mems_allowed);
mutex_unlock(&callback_mutex);
return allowed;
}
Expand Down

0 comments on commit 99afb0f

Please sign in to comment.