====================================================== WARNING: possible circular locking dependency detected 6.3.0-syzkaller-07967-g6e61c5fa4d43 #0 Not tainted ------------------------------------------------------ syz-executor365/5006 is trying to acquire lock: ffffffff8c640a90 (cpu_hotplug_lock){++++}-{0:0}, at: static_key_slow_inc+0x13/0x30 kernel/jump_label.c:185 but task is already holding lock: ffffffff8c7e9428 (freezer_mutex){+.+.}-{3:3}, at: freezer_css_online+0x55/0x170 kernel/cgroup/legacy_freezer.c:111 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (freezer_mutex){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12f/0x1350 kernel/locking/mutex.c:747 freezer_change_state kernel/cgroup/legacy_freezer.c:389 [inline] freezer_write+0xa1/0xb50 kernel/cgroup/legacy_freezer.c:429 cgroup_file_write+0x1e2/0x7b0 kernel/cgroup/cgroup.c:4071 kernfs_fop_write_iter+0x3f1/0x600 fs/kernfs/file.c:334 call_write_iter include/linux/fs.h:1854 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9ee/0xe10 fs/read_write.c:584 ksys_write+0x12b/0x250 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (cpu_hotplug_lock){++++}-{0:0}: check_prev_add kernel/locking/lockdep.c:3108 [inline] check_prevs_add kernel/locking/lockdep.c:3227 [inline] validate_chain kernel/locking/lockdep.c:3842 [inline] __lock_acquire+0x2f21/0x5df0 kernel/locking/lockdep.c:5074 lock_acquire kernel/locking/lockdep.c:5691 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5656 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] cpus_read_lock+0x42/0x160 kernel/cpu.c:310 static_key_slow_inc+0x13/0x30 kernel/jump_label.c:185 freezer_css_online+0x102/0x170 kernel/cgroup/legacy_freezer.c:117 online_css+0xaf/0x2a0 kernel/cgroup/cgroup.c:5491 css_create kernel/cgroup/cgroup.c:5562 [inline] cgroup_apply_control_enable+0x69b/0xc00 kernel/cgroup/cgroup.c:3249 cgroup_mkdir+0x5b9/0x10b0 kernel/cgroup/cgroup.c:5758 kernfs_iop_mkdir+0x14a/0x1d0 fs/kernfs/dir.c:1214 vfs_mkdir+0x242/0x460 fs/namei.c:4038 do_mkdirat+0x28d/0x310 fs/namei.c:4061 __do_sys_mkdirat fs/namei.c:4076 [inline] __se_sys_mkdirat fs/namei.c:4074 [inline] __x64_sys_mkdirat+0x119/0x170 fs/namei.c:4074 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(freezer_mutex); lock(cpu_hotplug_lock); lock(freezer_mutex); rlock(cpu_hotplug_lock); *** DEADLOCK *** 4 locks held by syz-executor365/5006: #0: ffff8880797ca460 (sb_writers#10){.+.+}-{0:0}, at: filename_create+0xf1/0x4a0 fs/namei.c:3801 #1: ffff888077e64660 (&type->i_mutex_dir_key#7/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:796 [inline] #1: ffff888077e64660 (&type->i_mutex_dir_key#7/1){+.+.}-{3:3}, at: filename_create+0x1aa/0x4a0 fs/namei.c:3808 #2: ffffffff8c7de708 (cgroup_mutex){+.+.}-{3:3}, at: cgroup_kn_lock_live+0x138/0x520 kernel/cgroup/cgroup.c:1683 #3: ffffffff8c7e9428 (freezer_mutex){+.+.}-{3:3}, at: freezer_css_online+0x55/0x170 kernel/cgroup/legacy_freezer.c:111 stack backtrace: CPU: 1 PID: 5006 Comm: syz-executor365 Not tainted 6.3.0-syzkaller-07967-g6e61c5fa4d43 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2188 check_prev_add kernel/locking/lockdep.c:3108 [inline] check_prevs_add kernel/locking/lockdep.c:3227 [inline] validate_chain kernel/locking/lockdep.c:3842 [inline] __lock_acquire+0x2f21/0x5df0 kernel/locking/lockdep.c:5074 lock_acquire kernel/locking/lockdep.c:5691 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5656 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] cpus_read_lock+0x42/0x160 kernel/cpu.c:310 static_key_slow_inc+0x13/0x30 kernel/jump_label.c:185 freezer_css_online+0x102/0x170 kernel/cgroup/legacy_freezer.c:117 online_css+0xaf/0x2a0 kernel/cgroup/cgroup.c:5491 css_create kernel/cgroup/cgroup.c:5562 [inline] cgroup_apply_control_enable+0x69b/0xc00 kernel/cgroup/cgroup.c:3249 cgroup_mkdir+0x5b9/0x10b0 kernel/cgroup/cgroup.c:5758 kernfs_iop_mkdir+0x14a/0x1d0 fs/kernfs/dir.c:1214 vfs_mkdir+0x242/0x460 fs/namei.c:4038 do_mkdirat+0x28d/0x310 fs/namei.c:4061 __do_sys_mkdirat fs/namei.c:4076 [inline] __se_sys_mkdirat fs/namei.c:4074 [inline] __x64_sys_mkdirat+0x119/0x170 fs/namei.c:4074 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fed9d0b0e09 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 15 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffcbf2430c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fed9d0b0e09 RDX: 00000000000001ff RSI: 0000000020000180 RDI: 0000000000000003 RBP: 0000000000000000 R08: 00007ffcbf2430f0 R09: 00007ffcbf2430f0 R10: 00007ffcbf2430f0 R11: 0000000000000246 R12: 00007ffcbf2430ec R13: 00007ffcbf243100 R14: 00007ffcbf243140 R15: 0000000000000000