diff options
author | Li Zefan <lizefan@huawei.com> | 2014-02-27 18:19:36 +0800 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-02-27 09:39:54 -0500 |
commit | 99afb0fd5f05aac467ffa85c36778fec4396209b (patch) | |
tree | 0cac821aec4a1dd0a6a86473df5b03864b788a81 /kernel/cpuset.c | |
parent | 4729583006772b9530404bc1bb7c3aa4a10ffd4d (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.c | 2 |
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; } |