summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLi Zefan <lizefan@huawei.com>2014-02-27 18:19:36 +0800
committerBen Hutchings <ben@decadent.org.uk>2014-04-02 00:58:56 +0100
commitb2faa4da5e697d943efa5b8126f736df6f913496 (patch)
tree5252f039579834c7d54000563c09b09f8fb8ca85 /kernel
parent7b80b8d77f13e7d8a88179a208b839b31a9f667d (diff)
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: Ben Hutchings <ben@decadent.org.uk>
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 57eb98d1d887..1e2c5f025dcf 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2366,9 +2366,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;
}