[PATCH 3.11 021/144] cpuset: fix a race condition in __cpuset_node_allowed_softwall()
Luis Henriques
luis.henriques at canonical.com
Tue Apr 1 11:13:45 UTC 2014
3.11.10.7 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Zefan <lizefan at huawei.com>
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 at huawei.com>
Signed-off-by: Tejun Heo <tj at kernel.org>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
kernel/cpuset.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 84773c7..26e7a5d 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2518,9 +2518,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;
}
--
1.9.1
More information about the kernel-team
mailing list