summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLi Zefan <lizefan@huawei.com>2014-02-27 11:19:36 +0100
committerTejun Heo <tj@kernel.org>2014-02-27 15:39:54 +0100
commit99afb0fd5f05aac467ffa85c36778fec4396209b (patch)
tree0cac821aec4a1dd0a6a86473df5b03864b788a81 /kernel
parentcpuset: fix a locking issue in cpuset_migrate_mm() (diff)
downloadlinux-99afb0fd5f05aac467ffa85c36778fec4396209b.tar.xz
linux-99afb0fd5f05aac467ffa85c36778fec4396209b.zip
cpuset: fix a race condition in __cpuset_node_allowed_softwall()
It's not safe to access task's cpuset after releasing task_lock(). Holding callback_mutex won't help. Cc: <stable@vger.kernel.org> Signed-off-by: Li Zefan <lizefan@huawei.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cpuset.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index dba9e4aef69a..e6b1b66afe52 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -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;
}