diff options
| author | Waiman Long <longman@redhat.com> | 2026-10-05 06:43:10 -0400 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-10-06 06:36:51 -1000 |
| commit | b8eb5fd5bdb4c03758b056c70e5e1d962ca89757 (patch) | |
| tree | abe8cbb62fa109a01525581d4033fbabfc7c60e1 /kernel/workqueue_internal.h | |
| parent | 23b1ab15ca91f2cffaf149d9bb0fafeb700c7db2 (diff) | |
| download | linux-next-b8eb5fd5bdb4c03758b056c70e5e1d962ca89757.tar.gz linux-next-b8eb5fd5bdb4c03758b056c70e5e1d962ca89757.zip | |
cgroup/cpuset: Call is_in_v2_mode() after acquiring cpuset_mutex in cpuset_handle_hotplug()
It is reported by sashiko that calling is_in_v2_mode() outside of
cpuset_mutex critical section in cpuset_handle_hotplug() can introduce
a TOCTOU race where cgroup hierarchy may have changed from v1 to v2 or
vice versa after is_in_v2_mode() is called leading to erroneously skip
the allocation of tmpmasks or incorrectly modify cpus_allowed masks,
resulting in cpuset state corruption. Fix that by calling is_in_v2_mode()
after acquiring the cpuset_mutex.
Fixes: b8d1b8ee93df ("cpuset: Allow v2 behavior in v1 cgroup")
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue_internal.h')
0 files changed, 0 insertions, 0 deletions
