]> git.baikalelectronics.ru Git - kernel.git/commit
cgroup: Add missing cpus_read_lock() to cgroup_attach_task_all()
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Thu, 25 Aug 2022 08:38:38 +0000 (17:38 +0900)
committerTejun Heo <tj@kernel.org>
Thu, 25 Aug 2022 17:36:30 +0000 (07:36 -1000)
commitd1e2d74f2ee89a371358695f9f4eeeeeb40a2745
tree06f2784c54257714e1576003999fae747af04df7
parentd1a0e4e23123d1691acd429692f72b0327185843
cgroup: Add missing cpus_read_lock() to cgroup_attach_task_all()

syzbot is hitting percpu_rwsem_assert_held(&cpu_hotplug_lock) warning at
cpuset_attach() [1], for commit c816169ad60e4e64 ("cgroup: Fix
threadgroup_rwsem <-> cpus_read_lock() deadlock") missed that
cpuset_attach() is also called from cgroup_attach_task_all().
Add cpus_read_lock() like what cgroup_procs_write_start() does.

Link: https://syzkaller.appspot.com/bug?extid=29d3a3b4d86c8136ad9e
Reported-by: syzbot <syzbot+29d3a3b4d86c8136ad9e@syzkaller.appspotmail.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Fixes: c816169ad60e4e64 ("cgroup: Fix threadgroup_rwsem <-> cpus_read_lock() deadlock")
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup-v1.c