R13: 00007ffc93da7f9f R14: 00007f1d70709300 R15: 0000000000022000 ====================================================== WARNING: possible circular locking dependency detected 6.1.0-rc7-syzkaller-01763-g65e6af6cebef #0 Not tainted ------------------------------------------------------ syz-executor.5/26340 is trying to acquire lock: ffff88807893c0a8 ((&sq->pending_timer)){+.-.}-{0:0}, at: del_timer_sync+0x37/0x1b0 kernel/time/timer.c:1416 but task is already holding lock: ffffffff91b5eeb0 (&blkcg->lock){....}-{2:2}, at: spin_lock include/linux/spinlock.h:350 [inline] ffffffff91b5eeb0 (&blkcg->lock){....}-{2:2}, at: blkcg_deactivate_policy block/blk-cgroup.c:1467 [inline] ffffffff91b5eeb0 (&blkcg->lock){....}-{2:2}, at: blkcg_deactivate_policy+0x185/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+0x2e/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+0xe4/0x6a0 block/blk-cgroup.c:1238 __alloc_disk_node+0x2a1/0x650 block/genhd.c:1380 __blk_alloc_disk+0x39/0x90 block/genhd.c:1419 brd_alloc.part.0+0x281/0x760 drivers/block/brd.c:391 brd_alloc drivers/block/brd.c:374 [inline] brd_init+0x1bc/0x24f drivers/block/brd.c:477 do_one_initcall+0x141/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+0x1e/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+0x36/0x50 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:375 [inline] throtl_pending_timer_fn+0xfd/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+0xb7/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1fb/0xadc kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 irq_exit_rcu+0x9/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x97/0xc0 arch/x86/kernel/apic/apic.c:1107 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:649 __sanitizer_cov_trace_pc+0x0/0x70 kernel/kcov.c:526 queue_delayed_work_on+0xbf/0x120 kernel/workqueue.c:1706 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 -> #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+0x1e3/0x630 kernel/locking/lockdep.c:5633 del_timer_sync+0x63/0x1b0 kernel/time/timer.c:1417 throtl_pd_free+0x19/0x40 block/blk-throttle.c:493 blkcg_deactivate_policy block/blk-cgroup.c:1471 [inline] blkcg_deactivate_policy+0x270/0x470 block/blk-cgroup.c:1449 blk_throtl_exit+0xb7/0x1e0 block/blk-throttle.c:2406 blkcg_init_disk+0x1f2/0x6a0 block/blk-cgroup.c:1262 __alloc_disk_node+0x2a1/0x650 block/genhd.c:1380 __blk_mq_alloc_disk+0x13f/0x1f0 block/blk-mq.c:4035 nbd_dev_add+0x3b2/0xc20 drivers/block/nbd.c:1781 nbd_genl_connect+0x12c9/0x19d0 drivers/block/nbd.c:1964 genl_family_rcv_msg_doit.isra.0+0x1e6/0x2d0 net/netlink/genetlink.c:968 genl_family_rcv_msg net/netlink/genetlink.c:1048 [inline] genl_rcv_msg+0x4ff/0x7e0 net/netlink/genetlink.c:1065 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2564 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1076 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1356 netlink_sendmsg+0x91b/0xe10 net/netlink/af_netlink.c:1932 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2476 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2530 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2559 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/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.5/26340: #0: ffffffff8df546f0 (cb_lock){++++}-{3:3}, at: genl_rcv+0x19/0x40 net/netlink/genetlink.c:1075 #1: ffffffff8df547a8 (genl_mutex){+.+.}-{3:3}, at: genl_lock net/netlink/genetlink.c:33 [inline] #1: ffffffff8df547a8 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg+0x51a/0x7e0 net/netlink/genetlink.c:1063 #2: ffff88801f142320 (&q->queue_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:375 [inline] #2: ffff88801f142320 (&q->queue_lock){..-.}-{2:2}, at: blkcg_deactivate_policy block/blk-cgroup.c:1460 [inline] #2: ffff88801f142320 (&q->queue_lock){..-.}-{2:2}, at: blkcg_deactivate_policy+0x9f/0x470 block/blk-cgroup.c:1449 #3: ffffffff91b5eeb0 (&blkcg->lock){....}-{2:2}, at: spin_lock include/linux/spinlock.h:350 [inline] #3: ffffffff91b5eeb0 (&blkcg->lock){....}-{2:2}, at: blkcg_deactivate_policy block/blk-cgroup.c:1467 [inline] #3: ffffffff91b5eeb0 (&blkcg->lock){....}-{2:2}, at: blkcg_deactivate_policy+0x185/0x470 block/blk-cgroup.c:1449 stack backtrace: CPU: 0 PID: 26340 Comm: syz-executor.5 Not tainted 6.1.0-rc7-syzkaller-01763-g65e6af6cebef #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+0xd1/0x138 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+0x1e3/0x630 kernel/locking/lockdep.c:5633 del_timer_sync+0x63/0x1b0 kernel/time/timer.c:1417 throtl_pd_free+0x19/0x40 block/blk-throttle.c:493 blkcg_deactivate_policy block/blk-cgroup.c:1471 [inline] blkcg_deactivate_policy+0x270/0x470 block/blk-cgroup.c:1449 blk_throtl_exit+0xb7/0x1e0 block/blk-throttle.c:2406 blkcg_init_disk+0x1f2/0x6a0 block/blk-cgroup.c:1262 __alloc_disk_node+0x2a1/0x650 block/genhd.c:1380 __blk_mq_alloc_disk+0x13f/0x1f0 block/blk-mq.c:4035 nbd_dev_add+0x3b2/0xc20 drivers/block/nbd.c:1781 nbd_genl_connect+0x12c9/0x19d0 drivers/block/nbd.c:1964 genl_family_rcv_msg_doit.isra.0+0x1e6/0x2d0 net/netlink/genetlink.c:968 genl_family_rcv_msg net/netlink/genetlink.c:1048 [inline] genl_rcv_msg+0x4ff/0x7e0 net/netlink/genetlink.c:1065 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2564 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1076 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1356 netlink_sendmsg+0x91b/0xe10 net/netlink/af_netlink.c:1932 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 ____sys_sendmsg+0x712/0x8c0 net/socket.c:2476 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2530 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2559 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f1d6fa8c0d9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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:00007f1d70709168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f1d6fbabf80 RCX: 00007f1d6fa8c0d9 RDX: 0000000000000000 RSI: 0000000020000380 RDI: 0000000000000004 RBP: 00007f1d707091d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007ffc93da7f9f R14: 00007f1d70709300 R15: 0000000000022000 nbd: failed to add new device