aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLi Zefan <lizefan@huawei.com>2014-02-27 05:19:36 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-03-24 00:38:15 -0400
commit4bdd401e8b7384a685606f2254e634805580a2aa (patch)
treeb5d481b1d6ffc45582d4f8c31e823ca97180c3ba /kernel
parent56f1c4124bd0c769591071916abc5358b8811c1a (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: Greg Kroah-Hartman <gregkh@linuxfoundation.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 d313870dcd02..d9dd521ddd6b 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2422,9 +2422,9 @@ int __cpuset_node_allowed_softwall(int node, gfp_t gfp_mask)
2422 2422
2423 task_lock(current); 2423 task_lock(current);
2424 cs = nearest_hardwall_ancestor(task_cs(current)); 2424 cs = nearest_hardwall_ancestor(task_cs(current));
2425 allowed = node_isset(node, cs->mems_allowed);
2425 task_unlock(current); 2426 task_unlock(current);
2426 2427
2427 allowed = node_isset(node, cs->mems_allowed);
2428 mutex_unlock(&callback_mutex); 2428 mutex_unlock(&callback_mutex);
2429 return allowed; 2429 return allowed;
2430} 2430}