====================================================== WARNING: possible circular locking dependency detected 6.4.0-rc5-syzkaller-00002-gf8dba31b0a82 #0 Not tainted ------------------------------------------------------ syz-executor.0/3870 is trying to acquire lock: ffffffff8c640a70 (cpu_hotplug_lock){++++}-{0:0}, at: static_key_slow_inc+0x13/0x30 kernel/jump_label.c:185 but task is already holding lock: ffffffff8c7ec4e8 (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:1868 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x945/0xd50 fs/read_write.c:584 ksys_write+0x12b/0x250 fs/read_write.c:637 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 -> #0 (cpu_hotplug_lock){++++}-{0:0}: check_prev_add kernel/locking/lockdep.c:3113 [inline] check_prevs_add kernel/locking/lockdep.c:3232 [inline] validate_chain kernel/locking/lockdep.c:3847 [inline] __lock_acquire+0x2fcd/0x5f30 kernel/locking/lockdep.c:5088 lock_acquire kernel/locking/lockdep.c:5705 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5670 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:1219 vfs_mkdir+0x242/0x460 fs/namei.c:4115 do_mkdirat+0x28d/0x310 fs/namei.c:4138 __do_sys_mkdirat fs/namei.c:4153 [inline] __se_sys_mkdirat fs/namei.c:4151 [inline] __ia32_sys_mkdirat+0x85/0xb0 fs/namei.c:4151 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 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-executor.0/3870: #0: ffff888000cd0460 (sb_writers #11){.+.+}-{0:0} , at: filename_create+0xf5/0x4a0 fs/namei.c:3877 #1: ffff888019fb5250 (&type->i_mutex_dir_key#7/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:810 [inline] #1: ffff888019fb5250 (&type->i_mutex_dir_key#7/1){+.+.}-{3:3}, at: filename_create+0x1ae/0x4a0 fs/namei.c:3884 #2: ffffffff8c7e17c8 (cgroup_mutex){+.+.}-{3:3}, at: cgroup_lock include/linux/cgroup.h:370 [inline] #2: ffffffff8c7e17c8 (cgroup_mutex){+.+.}-{3:3}, at: cgroup_kn_lock_live+0x138/0x520 kernel/cgroup/cgroup.c:1683 #3: ffffffff8c7ec4e8 (freezer_mutex){+.+.}-{3:3}, at: freezer_css_online+0x55/0x170 kernel/cgroup/legacy_freezer.c:111 stack backtrace: CPU: 1 PID: 3870 Comm: syz-executor.0 Not tainted 6.4.0-rc5-syzkaller-00002-gf8dba31b0a82 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 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:3113 [inline] check_prevs_add kernel/locking/lockdep.c:3232 [inline] validate_chain kernel/locking/lockdep.c:3847 [inline] __lock_acquire+0x2fcd/0x5f30 kernel/locking/lockdep.c:5088 lock_acquire kernel/locking/lockdep.c:5705 [inline] lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5670 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:1219 vfs_mkdir+0x242/0x460 fs/namei.c:4115 do_mkdirat+0x28d/0x310 fs/namei.c:4138 __do_sys_mkdirat fs/namei.c:4153 [inline] __se_sys_mkdirat fs/namei.c:4151 [inline] __ia32_sys_mkdirat+0x85/0xb0 fs/namei.c:4151 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 RIP: 0023:0xf7f42579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f7f1c5cc EFLAGS: 00000296 ORIG_RAX: 0000000000000128 RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 0000000020000180 RDX: 00000000000001ff RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 retq 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi