====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Tainted: G L ------------------------------------------------------ syz.5.1623/11091 is trying to acquire lock: ffffffff8efc9ea0 (fs_reclaim){+.+.}-{0:0}, at: might_alloc include/linux/sched/mm.h:316 [inline] ffffffff8efc9ea0 (fs_reclaim){+.+.}-{0:0}, at: slab_pre_alloc_hook mm/slub.c:4636 [inline] ffffffff8efc9ea0 (fs_reclaim){+.+.}-{0:0}, at: slab_alloc_node mm/slub.c:4974 [inline] ffffffff8efc9ea0 (fs_reclaim){+.+.}-{0:0}, at: __do_kmalloc_node mm/slub.c:5413 [inline] ffffffff8efc9ea0 (fs_reclaim){+.+.}-{0:0}, at: __kmalloc_noprof+0xce/0x840 mm/slub.c:5439 but task is already holding lock: ffff88801d2bf180 (&root->kernfs_rwsem){++++}-{4:4}, at: kernfs_fop_readdir+0x161/0xa00 fs/kernfs/dir.c:1982 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #9 (&root->kernfs_rwsem){++++}-{4:4}: lock_acquire kernel/locking/lockdep.c:5908 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5865 down_write+0x8b/0x1f0 kernel/locking/rwsem.c:1631 kernfs_add_one+0x38/0xaa0 fs/kernfs/dir.c:825 kernfs_create_dir_ns+0x157/0x2b0 fs/kernfs/dir.c:1130 internal_create_group+0x36f/0xfb0 fs/sysfs/group.c:176 cpuhp_invoke_callback+0x3b4/0x9a0 kernel/cpu.c:194 cpuhp_issue_call+0x1b8/0x970 kernel/cpu.c:2354 __cpuhp_setup_state_cpuslocked+0x431/0x880 kernel/cpu.c:2507 __cpuhp_setup_state+0xf7/0x2f0 kernel/cpu.c:2536 do_one_initcall+0x11c/0x6f0 init/main.c:1357 do_initcall_level init/main.c:1419 [inline] do_initcalls init/main.c:1435 [inline] do_basic_setup init/main.c:1455 [inline] kernel_init_freeable+0x6ea/0x7b0 init/main.c:1670 kernel_init+0x21/0x1e0 init/main.c:1560 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #8 (cpuhp_state_mutex){+.+.}-{4:4}: -> #7 (cpu_hotplug_lock){++++}-{0:0}: lock_acquire kernel/locking/lockdep.c:5908 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5865 percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline] percpu_down_read include/linux/percpu-rwsem.h:77 [inline] cpus_read_lock+0x42/0x170 kernel/cpu.c:490 static_key_disable+0x12/0x20 kernel/jump_label.c:247 __inet_hash_connect+0x143e/0x2000 net/ipv4/inet_hashtables.c:1081 tcp_v4_connect+0xeb3/0x1b40 net/ipv4/tcp_ipv4.c:306 __inet_stream_connect+0x208/0xf90 net/ipv4/af_inet.c:684 inet_stream_connect+0x57/0xa0 net/ipv4/af_inet.c:755 connect_socket net/socket.c:2141 [inline] connect_socket net/socket.c:2131 [inline] __sys_connect_file+0x146/0x1a0 net/socket.c:2166 __sys_connect+0x141/0x170 net/socket.c:2183 __do_sys_connect net/socket.c:2189 [inline] __se_sys_connect net/socket.c:2186 [inline] __x64_sys_connect+0x72/0xb0 net/socket.c:2186 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #6 (sk_lock-AF_INET){+.+.}-{0:0}: lock_acquire kernel/locking/lockdep.c:5908 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5865 lock_sock_nested+0x41/0xf0 net/core/sock.c:3827 lock_sock include/net/sock.h:1713 [inline] inet_shutdown+0x67/0x410 net/ipv4/af_inet.c:913 nbd_mark_nsock_dead+0xae/0x5c0 drivers/block/nbd.c:319 recv_work+0x5fb/0x8c0 drivers/block/nbd.c:1030 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396 process_scheduled_works kernel/workqueue.c:3479 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #5 (&nsock->tx_lock){+.+.}-{4:4}: lock_acquire kernel/locking/lockdep.c:5908 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5865 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x1a4/0x1bd0 kernel/locking/mutex.c:821 nbd_handle_cmd drivers/block/nbd.c:1143 [inline] nbd_queue_rq+0x42d/0xfa0 drivers/block/nbd.c:1207 blk_mq_dispatch_rq_list+0x428/0x1e60 block/blk-mq.c:2117 __blk_mq_do_dispatch_sched block/blk-mq-sched.c:168 [inline] blk_mq_do_dispatch_sched block/blk-mq-sched.c:182 [inline] __blk_mq_sched_dispatch_requests+0xcea/0x1620 block/blk-mq-sched.c:307 blk_mq_sched_dispatch_requests+0xd7/0x1c0 block/blk-mq-sched.c:329 blk_mq_run_work_fn+0x135/0x380 block/blk-mq.c:2531 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396 process_scheduled_works kernel/workqueue.c:3479 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #4 (&cmd->lock){+.+.}-{4:4}: lock_acquire kernel/locking/lockdep.c:5908 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5865 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x1a4/0x1bd0 kernel/locking/mutex.c:821 nbd_queue_rq+0xba/0xfa0 drivers/block/nbd.c:1199 blk_mq_dispatch_rq_list+0x428/0x1e60 block/blk-mq.c:2117 __blk_mq_do_dispatch_sched block/blk-mq-sched.c:168 [inline] blk_mq_do_dispatch_sched block/blk-mq-sched.c:182 [inline] __blk_mq_sched_dispatch_requests+0xcea/0x1620 block/blk-mq-sched.c:307 blk_mq_sched_dispatch_requests+0xd7/0x1c0 block/blk-mq-sched.c:329 blk_mq_run_work_fn+0x135/0x380 block/blk-mq.c:2531 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396 process_scheduled_works kernel/workqueue.c:3479 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #3 (set->srcu){.+.+}-{0:0}: lock_sync kernel/locking/lockdep.c:5957 [inline] lock_sync+0xb5/0x120 kernel/locking/lockdep.c:5945 srcu_lock_sync include/linux/srcu.h:210 [inline] __synchronize_srcu+0xa2/0x300 kernel/rcu/srcutree.c:1462 blk_mq_wait_quiesce_done block/blk-mq.c:284 [inline] blk_mq_wait_quiesce_done block/blk-mq.c:281 [inline] blk_mq_quiesce_queue block/blk-mq.c:304 [inline] blk_mq_quiesce_queue+0x149/0x1c0 block/blk-mq.c:299 elevator_switch+0x17b/0x7e0 block/elevator.c:576 elevator_change+0x352/0x530 block/elevator.c:681 elevator_set_default+0x29e/0x360 block/elevator.c:754 blk_register_queue+0x48e/0x630 block/blk-sysfs.c:992 __add_disk+0x73f/0xe40 block/genhd.c:524 add_disk_fwnode+0x118/0x480 block/genhd.c:593 add_disk include/linux/blkdev.h:798 [inline] nbd_dev_add+0x779/0xb10 drivers/block/nbd.c:2026 nbd_init+0x2c5/0x2e0 drivers/block/nbd.c:2743 do_one_initcall+0x11c/0x6f0 init/main.c:1357 do_initcall_level init/main.c:1419 [inline] do_initcalls init/main.c:1435 [inline] do_basic_setup init/main.c:1455 [inline] kernel_init_freeable+0x6ea/0x7b0 init/main.c:1670 kernel_init+0x21/0x1e0 init/main.c:1560 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #2 (&q->elevator_lock){+.+.}-{4:4}: lock_acquire kernel/locking/lockdep.c:5908 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5865 __mutex_lock_common kernel/locking/mutex.c:646 [inline] __mutex_lock+0x1a4/0x1bd0 kernel/locking/mutex.c:821 elevator_change+0x1bc/0x530 block/elevator.c:679 elevator_set_none+0x92/0xf0 block/elevator.c:769 blk_mq_elv_switch_none block/blk-mq.c:5102 [inline] __blk_mq_update_nr_hw_queues block/blk-mq.c:5147 [inline] blk_mq_update_nr_hw_queues+0x4c1/0x15f0 block/blk-mq.c:5212 nbd_start_device+0x1a6/0xbd0 drivers/block/nbd.c:1530 nbd_genl_connect+0xfc2/0x1760 drivers/block/nbd.c:2310 genl_family_rcv_msg_doit+0x214/0x300 net/netlink/genetlink.c:1114 genl_family_rcv_msg net/netlink/genetlink.c:1194 [inline] genl_rcv_msg+0x560/0x800 net/netlink/genetlink.c:1209 netlink_rcv_skb+0x159/0x420 net/netlink/af_netlink.c:2556 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1218 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x585/0x850 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x8b0/0xda0 net/netlink/af_netlink.c:1900 sock_sendmsg_nosec net/socket.c:800 [inline] __sock_sendmsg net/socket.c:815 [inline] ____sys_sendmsg+0xa4d/0xbe0 net/socket.c:2713 ___sys_sendmsg+0x190/0x1e0 net/socket.c:2767 __sys_sendmsg+0x160/0x210 net/socket.c:2799 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&q->q_usage_counter(io)#50){++++}-{0:0}: lock_acquire kernel/locking/lockdep.c:5908 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5865 blk_alloc_queue+0x610/0x790 block/blk-core.c:504 blk_mq_alloc_queue+0x174/0x290 block/blk-mq.c:4420 __blk_mq_alloc_disk+0x29/0x120 block/blk-mq.c:4467 nbd_dev_add+0x491/0xb10 drivers/block/nbd.c:1996 nbd_init+0x2c5/0x2e0 drivers/block/nbd.c:2743 do_one_initcall+0x11c/0x6f0 init/main.c:1357 do_initcall_level init/main.c:1419 [inline] do_initcalls init/main.c:1435 [inline] do_basic_setup init/main.c:1455 [inline] kernel_init_freeable+0x6ea/0x7b0 init/main.c:1670 kernel_init+0x21/0x1e0 init/main.c:1560 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #0 (fs_reclaim){+.+.}-{0:0}: check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3181 check_prevs_add kernel/locking/lockdep.c:3300 [inline] validate_chain kernel/locking/lockdep.c:3924 [inline] __lock_acquire+0x1492/0x1ec0 kernel/locking/lockdep.c:5254 lock_acquire kernel/locking/lockdep.c:5908 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5865 __fs_reclaim_acquire mm/page_alloc.c:4375 [inline] fs_reclaim_acquire+0xc4/0x100 mm/page_alloc.c:4389 might_alloc include/linux/sched/mm.h:316 [inline] slab_pre_alloc_hook mm/slub.c:4636 [inline] slab_alloc_node mm/slub.c:4974 [inline] __do_kmalloc_node mm/slub.c:5413 [inline] __kmalloc_noprof+0xce/0x840 mm/slub.c:5439 _kmalloc_noprof include/linux/slab.h:995 [inline] ovl_cache_entry_new+0x64/0x9d0 fs/overlayfs/readdir.c:183 ovl_cache_entry_add_rb fs/overlayfs/readdir.c:230 [inline] ovl_fill_merge+0x7dd/0x1000 fs/overlayfs/readdir.c:336 dir_emit include/linux/fs.h:3607 [inline] kernfs_fop_readdir+0x3f3/0xa00 fs/kernfs/dir.c:1999 iterate_dir+0x296/0xae0 fs/readdir.c:110 ovl_dir_read fs/overlayfs/readdir.c:388 [inline] ovl_dir_read_merged+0x37e/0x790 fs/overlayfs/readdir.c:451 ovl_cache_get fs/overlayfs/readdir.c:504 [inline] ovl_iterate_merged fs/overlayfs/readdir.c:846 [inline] ovl_iterate+0xb2a/0x10d0 fs/overlayfs/readdir.c:906 wrap_directory_iterator+0xa2/0xe0 fs/readdir.c:67 iterate_dir+0x296/0xae0 fs/readdir.c:110 __do_sys_getdents64 fs/readdir.c:399 [inline] __se_sys_getdents64 fs/readdir.c:384 [inline] __x64_sys_getdents64+0x13b/0x2c0 fs/readdir.c:384 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: fs_reclaim --> cpuhp_state_mutex --> &root->kernfs_rwsem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(&root->kernfs_rwsem); lock(cpuhp_state_mutex); lock(&root->kernfs_rwsem); lock(fs_reclaim); *** DEADLOCK *** locks held by syz.5.1623/11091: 4, last CPU#0: #0: ffff888033926470 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x2aa/0x380 fs/file.c:1259 #1: ffff888055e1e3d0 (&ovl_i_mutex_dir_key[depth]){++++}-{4:4}, at: wrap_directory_iterator+0x54/0xe0 fs/readdir.c:56 #2: ffff88803bc64140 (&type->i_mutex_dir_key#4){++++}-{4:4}, at: iterate_dir+0x18b/0xae0 fs/readdir.c:103 #3: ffff88801d2bf180 (&root->kernfs_rwsem){++++}-{4:4}, at: kernfs_fop_readdir+0x161/0xa00 fs/kernfs/dir.c:1982 stack backtrace: CPU: 0 UID: 0 PID: 11091 Comm: syz.5.1623 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/05/2026 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_circular_bug.cold+0x178/0x1be kernel/locking/lockdep.c:2059 check_noncircular+0x146/0x160 kernel/locking/lockdep.c:2191 check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3181 check_prevs_add kernel/locking/lockdep.c:3300 [inline] validate_chain kernel/locking/lockdep.c:3924 [inline] __lock_acquire+0x1492/0x1ec0 kernel/locking/lockdep.c:5254 lock_acquire kernel/locking/lockdep.c:5908 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5865 __fs_reclaim_acquire mm/page_alloc.c:4375 [inline] fs_reclaim_acquire+0xc4/0x100 mm/page_alloc.c:4389 might_alloc include/linux/sched/mm.h:316 [inline] slab_pre_alloc_hook mm/slub.c:4636 [inline] slab_alloc_node mm/slub.c:4974 [inline] __do_kmalloc_node mm/slub.c:5413 [inline] __kmalloc_noprof+0xce/0x840 mm/slub.c:5439 _kmalloc_noprof include/linux/slab.h:995 [inline] ovl_cache_entry_new+0x64/0x9d0 fs/overlayfs/readdir.c:183 ovl_cache_entry_add_rb fs/overlayfs/readdir.c:230 [inline] ovl_fill_merge+0x7dd/0x1000 fs/overlayfs/readdir.c:336 dir_emit include/linux/fs.h:3607 [inline] kernfs_fop_readdir+0x3f3/0xa00 fs/kernfs/dir.c:1999 iterate_dir+0x296/0xae0 fs/readdir.c:110 ovl_dir_read fs/overlayfs/readdir.c:388 [inline] ovl_dir_read_merged+0x37e/0x790 fs/overlayfs/readdir.c:451 ovl_cache_get fs/overlayfs/readdir.c:504 [inline] ovl_iterate_merged fs/overlayfs/readdir.c:846 [inline] ovl_iterate+0xb2a/0x10d0 fs/overlayfs/readdir.c:906 wrap_directory_iterator+0xa2/0xe0 fs/readdir.c:67 iterate_dir+0x296/0xae0 fs/readdir.c:110 __do_sys_getdents64 fs/readdir.c:399 [inline] __se_sys_getdents64 fs/readdir.c:384 [inline] __x64_sys_getdents64+0x13b/0x2c0 fs/readdir.c:384 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x123/0x790 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f2f84f9e159 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2f831f6028 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007f2f85225fa0 RCX: 00007f2f84f9e159 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 00007f2f85035024 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f2f85226038 R14: 00007f2f85225fa0 R15: 00007fff1c4c3b08