====================================================== WARNING: possible circular locking dependency detected 6.1.0-rc3-syzkaller-00236-g23569b5652ee #0 Not tainted ------------------------------------------------------ syz-executor.2/23710 is trying to acquire lock: ffff888046d740a8 ((&sq->pending_timer)){+.-.}-{0:0}, at: del_timer_sync+0x33/0x1b0 kernel/time/timer.c:1416 but task is already holding lock: ffffffff9138bc70 (&blkcg->lock){....}-{2:2}, at: spin_lock include/linux/spinlock.h:350 [inline] ffffffff9138bc70 (&blkcg->lock){....}-{2:2}, at: blkcg_deactivate_policy block/blk-cgroup.c:1467 [inline] ffffffff9138bc70 (&blkcg->lock){....}-{2:2}, at: blkcg_deactivate_policy+0x181/0x470 block/blk-cgroup.c:1449 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&blkcg->lock){....}-{2:2}: __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:350 [inline] blkg_create+0x662/0x1260 block/blk-cgroup.c:319 blkcg_init_disk+0xe0/0x6a0 block/blk-cgroup.c:1238 __alloc_disk_node+0x29d/0x650 block/genhd.c:1379 __blk_alloc_disk+0x35/0x90 block/genhd.c:1418 brd_alloc.part.0+0x281/0x760 drivers/block/brd.c:391 brd_alloc drivers/block/brd.c:374 [inline] brd_init+0x1b8/0x24b drivers/block/brd.c:477 do_one_initcall+0x13d/0x780 init/main.c:1303 do_initcall_level init/main.c:1376 [inline] do_initcalls init/main.c:1392 [inline] do_basic_setup init/main.c:1411 [inline] kernel_init_freeable+0x6ff/0x788 init/main.c:1631 kernel_init+0x1a/0x1d0 init/main.c:1519 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 -> #1 (&q->queue_lock){..-.}-{2:2}: __raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline] _raw_spin_lock_irq+0x32/0x50 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:375 [inline] throtl_pending_timer_fn+0xf9/0x1ad0 block/blk-throttle.c:1193 call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x6a2/0xaf0 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1f7/0xad8 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1107 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649 instrument_atomic_read include/linux/instrumented.h:72 [inline] _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline] PageHead include/linux/page-flags.h:788 [inline] PageHeadHuge+0x56/0x200 mm/hugetlb.c:1905 folio_test_hugetlb include/linux/page-flags.h:831 [inline] folio_file_page include/linux/pagemap.h:683 [inline] filemap_map_pages+0xb3c/0x1a70 mm/filemap.c:3365 do_fault_around mm/memory.c:4523 [inline] do_read_fault mm/memory.c:4549 [inline] do_fault mm/memory.c:4683 [inline] handle_pte_fault mm/memory.c:4955 [inline] __handle_mm_fault+0x2162/0x3a40 mm/memory.c:5097 handle_mm_fault+0x1c8/0x780 mm/memory.c:5218 do_user_addr_fault+0x475/0x1210 arch/x86/mm/fault.c:1428 handle_page_fault arch/x86/mm/fault.c:1519 [inline] exc_page_fault+0x94/0x170 arch/x86/mm/fault.c:1575 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 -> #0 ((&sq->pending_timer)){+.-.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1df/0x630 kernel/locking/lockdep.c:5633 del_timer_sync+0x5b/0x1b0 kernel/time/timer.c:1417 throtl_pd_free+0x15/0x40 block/blk-throttle.c:493 blkcg_deactivate_policy block/blk-cgroup.c:1471 [inline] blkcg_deactivate_policy+0x26c/0x470 block/blk-cgroup.c:1449 blk_throtl_exit+0xb3/0x1e0 block/blk-throttle.c:2406 blkcg_init_disk+0x1ee/0x6a0 block/blk-cgroup.c:1262 __alloc_disk_node+0x29d/0x650 block/genhd.c:1379 __blk_mq_alloc_disk+0x13b/0x1f0 block/blk-mq.c:4034 nbd_dev_add+0x3b2/0xc20 drivers/block/nbd.c:1781 nbd_genl_connect+0x12c5/0x19d0 drivers/block/nbd.c:1964 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:756 genl_family_rcv_msg net/netlink/genetlink.c:833 [inline] genl_rcv_msg+0x441/0x780 net/netlink/genetlink.c:850 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2540 genl_rcv+0x24/0x40 net/netlink/genetlink.c:861 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2482 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536 __sys_sendmsg+0xf3/0x1c0 net/socket.c:2565 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Chain exists of: (&sq->pending_timer) --> &q->queue_lock --> &blkcg->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&blkcg->lock); lock(&q->queue_lock); lock(&blkcg->lock); lock((&sq->pending_timer)); *** DEADLOCK *** 4 locks held by syz-executor.2/23710: #0: ffffffff8d853370 (cb_lock){++++}-{3:3}, at: genl_rcv+0x15/0x40 net/netlink/genetlink.c:860 #1: ffffffff8d853428 (genl_mutex){+.+.}-{3:3}, at: genl_lock net/netlink/genetlink.c:33 [inline] #1: ffffffff8d853428 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg+0x509/0x780 net/netlink/genetlink.c:848 #2: ffff888035c250a8 (&q->queue_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:375 [inline] #2: ffff888035c250a8 (&q->queue_lock){..-.}-{2:2}, at: blkcg_deactivate_policy block/blk-cgroup.c:1460 [inline] #2: ffff888035c250a8 (&q->queue_lock){..-.}-{2:2}, at: blkcg_deactivate_policy+0x9b/0x470 block/blk-cgroup.c:1449 #3: ffffffff9138bc70 (&blkcg->lock){....}-{2:2}, at: spin_lock include/linux/spinlock.h:350 [inline] #3: ffffffff9138bc70 (&blkcg->lock){....}-{2:2}, at: blkcg_deactivate_policy block/blk-cgroup.c:1467 [inline] #3: ffffffff9138bc70 (&blkcg->lock){....}-{2:2}, at: blkcg_deactivate_policy+0x181/0x470 block/blk-cgroup.c:1449 stack backtrace: CPU: 1 PID: 23710 Comm: syz-executor.2 Not tainted 6.1.0-rc3-syzkaller-00236-g23569b5652ee #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2177 check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1df/0x630 kernel/locking/lockdep.c:5633 del_timer_sync+0x5b/0x1b0 kernel/time/timer.c:1417 throtl_pd_free+0x15/0x40 block/blk-throttle.c:493 blkcg_deactivate_policy block/blk-cgroup.c:1471 [inline] blkcg_deactivate_policy+0x26c/0x470 block/blk-cgroup.c:1449 blk_throtl_exit+0xb3/0x1e0 block/blk-throttle.c:2406 blkcg_init_disk+0x1ee/0x6a0 block/blk-cgroup.c:1262 __alloc_disk_node+0x29d/0x650 block/genhd.c:1379 __blk_mq_alloc_disk+0x13b/0x1f0 block/blk-mq.c:4034 nbd_dev_add+0x3b2/0xc20 drivers/block/nbd.c:1781 nbd_genl_connect+0x12c5/0x19d0 drivers/block/nbd.c:1964 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:756 genl_family_rcv_msg net/netlink/genetlink.c:833 [inline] genl_rcv_msg+0x441/0x780 net/netlink/genetlink.c:850 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2540 genl_rcv+0x24/0x40 net/netlink/genetlink.c:861 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x917/0xe10 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2482 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2536 __sys_sendmsg+0xf3/0x1c0 net/socket.c:2565 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7efcaa28b639 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007efca95ff168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007efcaa3abf80 RCX: 00007efcaa28b639 RDX: 0000000000000000 RSI: 0000000020000380 RDI: 0000000000000004 RBP: 00007efca95ff1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007ffe6b21d0ff R14: 00007efca95ff300 R15: 0000000000022000 nbd: failed to add new device