syzbot


possible deadlock in freezer_css_online

Status: closed as dup on 2023/07/08 11:43
Subsystems: cgroups
[Documentation on labels]
Reported-by: syzbot+387de8f7ae917a47dc5e@syzkaller.appspotmail.com
First crash: 374d, last: 349d
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
possible deadlock in static_key_slow_inc (3) cgroups C done 6387 323d 372d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [cgroups?] possible deadlock in freezer_css_online 0 (1) 2023/06/10 11:07

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.4.0-rc5-syzkaller-00002-gf8dba31b0a82 #0 Not tainted
------------------------------------------------------
syz-executor.1/11374 is trying to acquire lock:
ffff80000e31c1b0 (cpu_hotplug_lock){++++}-{0:0}, at: cpus_read_lock+0x10/0x1c kernel/cpu.c:310

but task is already holding lock:
ffff80000e4c0da8 (freezer_mutex){+.+.}-{3:3}, at: freezer_css_online+0x4c/0x178 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+0x124/0x830 kernel/locking/mutex.c:747
       mutex_lock_nested+0x24/0x30 kernel/locking/mutex.c:799
       freezer_change_state kernel/cgroup/legacy_freezer.c:389 [inline]
       freezer_write+0x84/0x640 kernel/cgroup/legacy_freezer.c:429
       cgroup_file_write+0x218/0x5b4 kernel/cgroup/cgroup.c:4071
       kernfs_fop_write_iter+0x264/0x3c4 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+0x4cc/0x748 fs/read_write.c:584
       ksys_write+0xec/0x1d0 fs/read_write.c:637
       __do_sys_write fs/read_write.c:649 [inline]
       __se_sys_write fs/read_write.c:646 [inline]
       __arm64_sys_write+0x6c/0x9c fs/read_write.c:646
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x6c/0x260 arch/arm64/kernel/syscall.c:52
       el0_svc_common.constprop.0+0xc4/0x254 arch/arm64/kernel/syscall.c:142
       do_el0_svc+0x50/0x124 arch/arm64/kernel/syscall.c:193
       el0_svc+0x4c/0x130 arch/arm64/kernel/entry-common.c:637
       el0t_64_sync_handler+0xb8/0xbc arch/arm64/kernel/entry-common.c:655
       el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591

-> #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+0x27c4/0x5270 kernel/locking/lockdep.c:5088
       lock_acquire kernel/locking/lockdep.c:5705 [inline]
       lock_acquire+0x478/0x7c0 kernel/locking/lockdep.c:5670
       percpu_down_read.constprop.0+0x58/0x1f0 include/linux/percpu-rwsem.h:51
       cpus_read_lock+0x10/0x1c kernel/cpu.c:310
       static_key_slow_inc+0x18/0x50 kernel/jump_label.c:185
       freezer_css_online+0xe4/0x178 kernel/cgroup/legacy_freezer.c:117
       online_css+0x90/0x260 kernel/cgroup/cgroup.c:5491
       css_create kernel/cgroup/cgroup.c:5562 [inline]
       cgroup_apply_control_enable+0x48c/0x960 kernel/cgroup/cgroup.c:3249
       cgroup_mkdir+0x4b0/0xdf0 kernel/cgroup/cgroup.c:5758
       kernfs_iop_mkdir+0x104/0x184 fs/kernfs/dir.c:1219
       vfs_mkdir+0x1a8/0x370 fs/namei.c:4115
       do_mkdirat+0x20c/0x24c fs/namei.c:4138
       __do_sys_mkdirat fs/namei.c:4153 [inline]
       __se_sys_mkdirat fs/namei.c:4151 [inline]
       __arm64_sys_mkdirat+0xdc/0x138 fs/namei.c:4151
       __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
       invoke_syscall+0x6c/0x260 arch/arm64/kernel/syscall.c:52
       el0_svc_common.constprop.0+0xc4/0x254 arch/arm64/kernel/syscall.c:142
       do_el0_svc+0x50/0x124 arch/arm64/kernel/syscall.c:193
       el0_svc+0x4c/0x130 arch/arm64/kernel/entry-common.c:637
       el0t_64_sync_handler+0xb8/0xbc arch/arm64/kernel/entry-common.c:655
       el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591

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.1/11374:
 #0: ffff0000143f8460 (sb_writers#10){.+.+}-{0:0}, at: __sb_start_write include/linux/fs.h:1494 [inline]
 #0: ffff0000143f8460 (sb_writers#10){.+.+}-{0:0}, at: sb_start_write include/linux/fs.h:1569 [inline]
 #0: ffff0000143f8460 (sb_writers#10){.+.+}-{0:0}, at: mnt_want_write+0x3c/0xb0 fs/namespace.c:394
 #1: ffff00000f0733f0 (&type->i_mutex_dir_key#7/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:810 [inline]
 #1: ffff00000f0733f0 (&type->i_mutex_dir_key#7/1){+.+.}-{3:3}, at: filename_create+0x150/0x348 fs/namei.c:3884
 #2: ffff80000e4b0fa8 (cgroup_mutex){+.+.}-{3:3}, at: cgroup_lock include/linux/cgroup.h:370 [inline]
 #2: ffff80000e4b0fa8 (cgroup_mutex){+.+.}-{3:3}, at: cgroup_kn_lock_live+0xe0/0x578 kernel/cgroup/cgroup.c:1683
 #3: ffff80000e4c0da8 (freezer_mutex){+.+.}-{3:3}, at: freezer_css_online+0x4c/0x178 kernel/cgroup/legacy_freezer.c:111

stack backtrace:
CPU: 0 PID: 11374 Comm: syz-executor.1 Not tainted 6.4.0-rc5-syzkaller-00002-gf8dba31b0a82 #0
Hardware name: linux,dummy-virt (DT)
Call trace:
 dump_backtrace+0x9c/0x11c arch/arm64/kernel/stacktrace.c:233
 show_stack+0x18/0x24 arch/arm64/kernel/stacktrace.c:240
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x74/0xd4 lib/dump_stack.c:106
 dump_stack+0x1c/0x28 lib/dump_stack.c:113
 print_circular_bug+0x400/0x704 kernel/locking/lockdep.c:2066
 check_noncircular+0x26c/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+0x27c4/0x5270 kernel/locking/lockdep.c:5088
 lock_acquire kernel/locking/lockdep.c:5705 [inline]
 lock_acquire+0x478/0x7c0 kernel/locking/lockdep.c:5670
 percpu_down_read.constprop.0+0x58/0x1f0 include/linux/percpu-rwsem.h:51
 cpus_read_lock+0x10/0x1c kernel/cpu.c:310
 static_key_slow_inc+0x18/0x50 kernel/jump_label.c:185
 freezer_css_online+0xe4/0x178 kernel/cgroup/legacy_freezer.c:117
 online_css+0x90/0x260 kernel/cgroup/cgroup.c:5491
 css_create kernel/cgroup/cgroup.c:5562 [inline]
 cgroup_apply_control_enable+0x48c/0x960 kernel/cgroup/cgroup.c:3249
 cgroup_mkdir+0x4b0/0xdf0 kernel/cgroup/cgroup.c:5758
 kernfs_iop_mkdir+0x104/0x184 fs/kernfs/dir.c:1219
 vfs_mkdir+0x1a8/0x370 fs/namei.c:4115
 do_mkdirat+0x20c/0x24c fs/namei.c:4138
 __do_sys_mkdirat fs/namei.c:4153 [inline]
 __se_sys_mkdirat fs/namei.c:4151 [inline]
 __arm64_sys_mkdirat+0xdc/0x138 fs/namei.c:4151
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x6c/0x260 arch/arm64/kernel/syscall.c:52
 el0_svc_common.constprop.0+0xc4/0x254 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x50/0x124 arch/arm64/kernel/syscall.c:193
 el0_svc+0x4c/0x130 arch/arm64/kernel/entry-common.c:637
 el0t_64_sync_handler+0xb8/0xbc arch/arm64/kernel/entry-common.c:655
 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591

Crashes (55):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/06 11:03 upstream f8dba31b0a82 a4ae4f42 .config console log report info ci-qemu2-arm64 possible deadlock in freezer_css_online
2023/07/01 11:01 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 bfc47836 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/07/01 08:09 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 af3053d2 .config console log report info ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/07/01 05:51 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 af3053d2 .config console log report info ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/07/01 03:05 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 af3053d2 .config console log report info ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/30 08:42 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 01298212 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/30 06:42 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 01298212 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/29 10:51 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 134ddc02 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/28 15:15 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 8064cb02 .config console log report info ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/27 16:32 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 4cd5bb25 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/27 13:18 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 4cd5bb25 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/27 06:02 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 4cd5bb25 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/27 03:21 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 4cd5bb25 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/25 22:02 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 79782afc .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/23 16:39 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 79782afc .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/23 14:49 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 79782afc .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/22 03:25 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 79782afc .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/21 14:32 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 79782afc .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/21 05:48 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 79782afc .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/21 00:28 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 0cf1feea .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/20 18:40 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 0cf1feea .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/20 15:27 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 0cf1feea .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/20 12:21 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 09ffe269 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/20 04:31 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 09ffe269 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/19 23:18 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 d521bc56 .config console log report info ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/19 17:18 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 d521bc56 .config console log report info ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/16 20:55 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 f3921d4d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/16 20:19 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 f3921d4d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/16 13:00 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 f3921d4d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/16 06:09 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 f3921d4d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/16 05:56 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 f3921d4d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/16 04:29 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes b104dbedbe61 f3921d4d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/15 12:36 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c ff5fb304 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/15 02:59 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c 76decb82 .config console log report info ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/14 21:17 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c 76decb82 .config console log report info ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/14 08:23 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c d2ee9228 .config console log report info ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/14 04:14 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c d2ee9228 .config console log report info ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/13 20:03 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c 2f9d8e43 .config console log report info ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/13 16:27 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c 2f9d8e43 .config console log report info ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/13 09:28 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c 749afb64 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/13 06:13 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c 749afb64 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/12 20:50 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c aaed0183 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/12 15:01 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c aaed0183 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/11 23:01 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c 49519f06 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/10 23:58 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c 49519f06 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/10 20:02 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c 49519f06 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/10 12:30 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c 49519f06 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/10 09:24 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c 49519f06 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/10 00:27 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c 9018a337 .config console log report info ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/09 23:15 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c 9018a337 .config console log report info ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/09 11:27 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 99a670b2069c 058b3a5a .config console log report info ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/08 22:12 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 49a0a3731596 058b3a5a .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
2023/06/08 17:56 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git fixes 49a0a3731596 058b3a5a .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu2-riscv64 possible deadlock in freezer_css_online
* Struck through repros no longer work on HEAD.