aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpuset.c
diff options
context:
space:
mode:
authorLi Zefan <lizefan@huawei.com>2014-02-27 05:19:36 -0500
committerTejun Heo <tj@kernel.org>2014-02-27 09:39:54 -0500
commit99afb0fd5f05aac467ffa85c36778fec4396209b (patch)
tree0cac821aec4a1dd0a6a86473df5b03864b788a81 /kernel/cpuset.c
parent4729583006772b9530404bc1bb7c3aa4a10ffd4d (diff)
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/cpuset.c')
-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)
2482 2482
2483 task_lock(current); 2483 task_lock(current);
2484 cs = nearest_hardwall_ancestor(task_cs(current)); 2484 cs = nearest_hardwall_ancestor(task_cs(current));
2485 allowed = node_isset(node, cs->mems_allowed);
2485 task_unlock(current); 2486 task_unlock(current);
2486 2487
2487 allowed = node_isset(node, cs->mems_allowed);
2488 mutex_unlock(&callback_mutex); 2488 mutex_unlock(&callback_mutex);
2489 return allowed; 2489 return allowed;
2490} 2490}