====================================================== WARNING: possible circular locking dependency detected 6.13.0-rc6-syzkaller-00038-g09a0fa92e5b4 #0 Not tainted ------------------------------------------------------ syz.2.1037/11984 is trying to acquire lock: ffff88802373f398 (&sb->s_type->i_mutex_key#3){++++}-{4:4}, at: inode_lock include/linux/fs.h:818 [inline] ffff88802373f398 (&sb->s_type->i_mutex_key#3){++++}-{4:4}, at: start_creating+0x130/0x310 fs/debugfs/inode.c:374 but task is already holding lock: ffffffff8e98aaa8 (relay_channels_mutex){+.+.}-{4:4}, at: relay_open+0x338/0x890 kernel/relay.c:515 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (relay_channels_mutex){+.+.}-{4:4}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x1ac/0xee0 kernel/locking/mutex.c:735 relay_prepare_cpu+0x2a/0x250 kernel/relay.c:438 cpuhp_invoke_callback+0x48d/0x830 kernel/cpu.c:194 __cpuhp_invoke_callback_range kernel/cpu.c:965 [inline] cpuhp_invoke_callback_range kernel/cpu.c:989 [inline] cpuhp_up_callbacks kernel/cpu.c:1020 [inline] _cpu_up+0x2b3/0x580 kernel/cpu.c:1690 cpu_up+0x184/0x230 kernel/cpu.c:1722 cpuhp_bringup_mask+0xdf/0x260 kernel/cpu.c:1788 cpuhp_bringup_cpus_parallel+0xf9/0x160 kernel/cpu.c:1878 bringup_nonboot_cpus+0x2b/0x50 kernel/cpu.c:1892 smp_init+0x34/0x150 kernel/smp.c:1009 kernel_init_freeable+0x417/0x5d0 init/main.c:1569 kernel_init+0x1d/0x2b0 init/main.c:1466 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #1 (cpu_hotplug_lock){++++}-{0:0}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] cpus_read_lock+0x42/0x150 kernel/cpu.c:490 acomp_ctx_get_cpu mm/zswap.c:886 [inline] zswap_compress mm/zswap.c:908 [inline] zswap_store_page mm/zswap.c:1439 [inline] zswap_store+0xa74/0x1ba0 mm/zswap.c:1546 swap_writepage+0x647/0xce0 mm/page_io.c:279 shmem_writepage+0x1248/0x1610 mm/shmem.c:1579 pageout mm/vmscan.c:696 [inline] shrink_folio_list+0x3b68/0x5ca0 mm/vmscan.c:1374 evict_folios+0x3c86/0x5800 mm/vmscan.c:4600 try_to_shrink_lruvec+0x9a6/0xc70 mm/vmscan.c:4796 lru_gen_shrink_lruvec mm/vmscan.c:4945 [inline] shrink_lruvec+0x53c/0x3160 mm/vmscan.c:5700 shrink_node_memcgs mm/vmscan.c:5936 [inline] shrink_node+0xb15/0x3e50 mm/vmscan.c:5977 shrink_zones mm/vmscan.c:6222 [inline] do_try_to_free_pages+0x78c/0x1cf0 mm/vmscan.c:6284 try_to_free_mem_cgroup_pages+0x48c/0xab0 mm/vmscan.c:6616 try_charge_memcg+0x8c7/0x1150 mm/memcontrol.c:2238 obj_cgroup_charge_pages+0x91/0x230 mm/memcontrol.c:2646 obj_cgroup_charge+0x380/0x5d0 mm/memcontrol.c:2937 __memcg_slab_post_alloc_hook+0x1b1/0x7e0 mm/memcontrol.c:2998 memcg_slab_post_alloc_hook mm/slub.c:2152 [inline] slab_post_alloc_hook mm/slub.c:4129 [inline] slab_alloc_node mm/slub.c:4168 [inline] kmem_cache_alloc_lru_noprof+0x28e/0x390 mm/slub.c:4187 alloc_inode+0x87/0x1a0 fs/inode.c:338 new_inode_pseudo fs/inode.c:1174 [inline] new_inode+0x22/0x1d0 fs/inode.c:1193 debugfs_get_inode fs/debugfs/inode.c:72 [inline] __debugfs_create_file+0x142/0x4b0 fs/debugfs/inode.c:433 kvm_create_vm_debugfs virt/kvm/kvm_main.c:1056 [inline] kvm_create_vm virt/kvm/kvm_main.c:1193 [inline] kvm_dev_ioctl_create_vm virt/kvm/kvm_main.c:5353 [inline] kvm_dev_ioctl+0x20d1/0x2460 virt/kvm/kvm_main.c:5395 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&sb->s_type->i_mutex_key#3){++++}-{4:4}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5226 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849 down_write+0x99/0x220 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:818 [inline] start_creating+0x130/0x310 fs/debugfs/inode.c:374 __debugfs_create_file+0x73/0x4b0 fs/debugfs/inode.c:423 relay_create_buf_file kernel/relay.c:360 [inline] relay_open_buf+0x600/0xd60 kernel/relay.c:389 relay_open+0x3aa/0x890 kernel/relay.c:517 do_blk_trace_setup+0x573/0x9b0 kernel/trace/blktrace.c:590 __blk_trace_setup kernel/trace/blktrace.c:630 [inline] blk_trace_ioctl+0x359/0x9a0 kernel/trace/blktrace.c:740 blkdev_ioctl+0x40c/0x6a0 block/ioctl.c:682 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &sb->s_type->i_mutex_key#3 --> cpu_hotplug_lock --> relay_channels_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(relay_channels_mutex); lock(cpu_hotplug_lock); lock(relay_channels_mutex); lock(&sb->s_type->i_mutex_key#3); *** DEADLOCK *** 2 locks held by syz.2.1037/11984: #0: ffff888142f7c3c8 (&q->debugfs_mutex){+.+.}-{4:4}, at: blk_trace_ioctl+0xdd/0x9a0 kernel/trace/blktrace.c:735 #1: ffffffff8e98aaa8 (relay_channels_mutex){+.+.}-{4:4}, at: relay_open+0x338/0x890 kernel/relay.c:515 stack backtrace: CPU: 1 UID: 0 PID: 11984 Comm: syz.2.1037 Not tainted 6.13.0-rc6-syzkaller-00038-g09a0fa92e5b4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2074 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5226 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849 down_write+0x99/0x220 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:818 [inline] start_creating+0x130/0x310 fs/debugfs/inode.c:374 __debugfs_create_file+0x73/0x4b0 fs/debugfs/inode.c:423 relay_create_buf_file kernel/relay.c:360 [inline] relay_open_buf+0x600/0xd60 kernel/relay.c:389 relay_open+0x3aa/0x890 kernel/relay.c:517 do_blk_trace_setup+0x573/0x9b0 kernel/trace/blktrace.c:590 __blk_trace_setup kernel/trace/blktrace.c:630 [inline] blk_trace_ioctl+0x359/0x9a0 kernel/trace/blktrace.c:740 blkdev_ioctl+0x40c/0x6a0 block/ioctl.c:682 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7ff3be785d29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ff3bf5aa038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007ff3be976240 RCX: 00007ff3be785d29 RDX: 0000000020000380 RSI: 00000000c0481273 RDI: 0000000000000009 RBP: 00007ff3be801b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007ff3be976240 R15: 00007ff3bea9fa28