cpuset: fix a race condition in __cpuset_node_allowed_softwall()
commit 99afb0fd5f 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>
This commit is contained in:
parent
56f1c4124b
commit
4bdd401e8b
1 changed files with 1 additions and 1 deletions
|
|
@ -2422,9 +2422,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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue