summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Zefan <lizefan@huawei.com>2014-02-27 10:19:36 (GMT)
committerJiri Slaby <jslaby@suse.cz>2014-03-22 21:01:55 (GMT)
commit44ba741a0f470c22c691586dea1e219df757fef2 (patch)
treebd3805a76a0985882af6c0d045c7d23894ba0877
parentd1275b0297b1995a15aab2361f4051684c18a2ea (diff)
downloadlinux-fsl-qoriq-44ba741a0f470c22c691586dea1e219df757fef2.tar.xz
cpuset: fix a race condition in __cpuset_node_allowed_softwall()
commit 99afb0fd5f05aac467ffa85c36778fec4396209b upstream. It's not safe to access task's cpuset after releasing task_lock(). Holding callback_mutex won't help. Signed-off-by: Li Zefan <lizefan@huawei.com> Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
-rw-r--r--kernel/cpuset.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index bd1dfa2..5ae9f95 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2507,9 +2507,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;
}