Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99afb0fd authored by Li Zefan's avatar Li Zefan Committed by Tejun Heo
Browse files

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: default avatarLi Zefan <lizefan@huawei.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 47295830
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2482,9 +2482,9 @@ int __cpuset_node_allowed_softwall(int node, gfp_t gfp_mask)


	task_lock(current);
	task_lock(current);
	cs = nearest_hardwall_ancestor(task_cs(current));
	cs = nearest_hardwall_ancestor(task_cs(current));
	allowed = node_isset(node, cs->mems_allowed);
	task_unlock(current);
	task_unlock(current);


	allowed = node_isset(node, cs->mems_allowed);
	mutex_unlock(&callback_mutex);
	mutex_unlock(&callback_mutex);
	return allowed;
	return allowed;
}
}