====================================================== WARNING: possible circular locking dependency detected 5.19.0-rc2-syzkaller-00241-g4b35035bcf80 #0 Not tainted ------------------------------------------------------ syz-executor.4/27818 is trying to acquire lock: ffff888074a560a8 ((&sq->pending_timer)){+.-.}-{0:0}, at: del_timer_sync+0xf5/0x2e0 kernel/time/timer.c:1417 but task is already holding lock: ffffffff9174c690 (&blkcg->lock){....}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] ffffffff9174c690 (&blkcg->lock){....}-{2:2}, at: blkcg_deactivate_policy+0x1ab/0x540 block/blk-cgroup.c:1515 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&blkcg->lock){....}-{2:2}: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5665 __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:349 [inline] blkg_create+0x949/0x10a0 block/blk-cgroup.c:344 blkcg_init_queue+0xb9/0x2f0 block/blk-cgroup.c:1282 __alloc_disk_node+0x250/0x4d0 block/genhd.c:1383 __blk_alloc_disk+0x2d/0x60 block/genhd.c:1423 brd_alloc+0x316/0x690 drivers/block/brd.c:391 brd_init+0x102/0x1c6 drivers/block/brd.c:477 do_one_initcall+0xbd/0x2b0 init/main.c:1295 do_initcall_level+0x168/0x218 init/main.c:1368 do_initcalls+0x4b/0x8c init/main.c:1384 kernel_init_freeable+0x43a/0x5c3 init/main.c:1610 kernel_init+0x19/0x2b0 init/main.c:1499 ret_from_fork+0x1f/0x30 -> #1 (&q->queue_lock){..-.}-{2:2}: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5665 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline] _raw_spin_lock_irq+0xcf/0x110 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:374 [inline] throtl_pending_timer_fn+0xe9/0xfb0 block/blk-throttle.c:1152 call_timer_fn+0xf5/0x210 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers+0x76a/0x980 kernel/time/timer.c:1790 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803 __do_softirq+0x382/0x793 kernel/softirq.c:571 __irq_exit_rcu+0xec/0x170 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x91/0xb0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x1b/0x20 get_current arch/x86/include/asm/current.h:15 [inline] preempt_latency_start kernel/sched/core.c:5560 [inline] preempt_count_add+0xa4/0x180 kernel/sched/core.c:5583 schedule+0xe4/0x1b0 kernel/sched/core.c:6499 freezable_schedule include/linux/freezer.h:172 [inline] do_nanosleep+0x1c0/0x7d0 kernel/time/hrtimer.c:2044 hrtimer_nanosleep+0x24d/0x490 kernel/time/hrtimer.c:2097 __do_sys_clock_nanosleep kernel/time/posix-timers.c:1267 [inline] __se_sys_clock_nanosleep kernel/time/posix-timers.c:1245 [inline] __x64_sys_clock_nanosleep+0x360/0x3f0 kernel/time/posix-timers.c:1245 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 -> #0 ((&sq->pending_timer)){+.-.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain+0x185c/0x65c0 kernel/locking/lockdep.c:3829 __lock_acquire+0x129a/0x1f80 kernel/locking/lockdep.c:5053 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5665 del_timer_sync+0x111/0x2e0 kernel/time/timer.c:1417 throtl_pd_free+0x15/0x40 block/blk-throttle.c:500 blkcg_deactivate_policy+0x328/0x540 block/blk-cgroup.c:1519 blk_throtl_exit+0x86/0x120 block/blk-throttle.c:2336 blkcg_init_queue+0x281/0x2f0 block/blk-cgroup.c:1301 __alloc_disk_node+0x250/0x4d0 block/genhd.c:1383 __blk_mq_alloc_disk+0x11b/0x1c0 block/blk-mq.c:3915 nbd_dev_add+0x35d/0xa80 drivers/block/nbd.c:1780 nbd_genl_connect+0xb25/0x2080 drivers/block/nbd.c:1963 genl_family_rcv_msg_doit net/netlink/genetlink.c:731 [inline] genl_family_rcv_msg net/netlink/genetlink.c:775 [inline] genl_rcv_msg+0xfbc/0x1490 net/netlink/genetlink.c:792 netlink_rcv_skb+0x1f0/0x460 net/netlink/af_netlink.c:2501 genl_rcv+0x24/0x40 net/netlink/genetlink.c:803 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x7e7/0x9c0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x9b3/0xcd0 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] ____sys_sendmsg+0x597/0x8e0 net/socket.c:2492 ___sys_sendmsg net/socket.c:2546 [inline] __sys_sendmsg+0x284/0x370 net/socket.c:2575 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 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.4/27818: #0: ffffffff8dc268b0 (cb_lock){++++}-{3:3}, at: genl_rcv+0x15/0x40 net/netlink/genetlink.c:802 #1: ffffffff8dc26768 (genl_mutex){+.+.}-{3:3}, at: genl_lock net/netlink/genetlink.c:33 [inline] #1: ffffffff8dc26768 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg+0x122/0x1490 net/netlink/genetlink.c:790 #2: ffff8880200e2e90 (&q->queue_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:374 [inline] #2: ffff8880200e2e90 (&q->queue_lock){..-.}-{2:2}, at: blkcg_deactivate_policy+0xe9/0x540 block/blk-cgroup.c:1508 #3: ffffffff9174c690 (&blkcg->lock){....}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] #3: ffffffff9174c690 (&blkcg->lock){....}-{2:2}, at: blkcg_deactivate_policy+0x1ab/0x540 block/blk-cgroup.c:1515 stack backtrace: CPU: 0 PID: 27818 Comm: syz-executor.4 Not tainted 5.19.0-rc2-syzkaller-00241-g4b35035bcf80 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2f7/0x3b0 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain+0x185c/0x65c0 kernel/locking/lockdep.c:3829 __lock_acquire+0x129a/0x1f80 kernel/locking/lockdep.c:5053 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5665 del_timer_sync+0x111/0x2e0 kernel/time/timer.c:1417 throtl_pd_free+0x15/0x40 block/blk-throttle.c:500 blkcg_deactivate_policy+0x328/0x540 block/blk-cgroup.c:1519 blk_throtl_exit+0x86/0x120 block/blk-throttle.c:2336 blkcg_init_queue+0x281/0x2f0 block/blk-cgroup.c:1301 __alloc_disk_node+0x250/0x4d0 block/genhd.c:1383 __blk_mq_alloc_disk+0x11b/0x1c0 block/blk-mq.c:3915 nbd_dev_add+0x35d/0xa80 drivers/block/nbd.c:1780 nbd_genl_connect+0xb25/0x2080 drivers/block/nbd.c:1963 genl_family_rcv_msg_doit net/netlink/genetlink.c:731 [inline] genl_family_rcv_msg net/netlink/genetlink.c:775 [inline] genl_rcv_msg+0xfbc/0x1490 net/netlink/genetlink.c:792 netlink_rcv_skb+0x1f0/0x460 net/netlink/af_netlink.c:2501 genl_rcv+0x24/0x40 net/netlink/genetlink.c:803 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x7e7/0x9c0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x9b3/0xcd0 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] ____sys_sendmsg+0x597/0x8e0 net/socket.c:2492 ___sys_sendmsg net/socket.c:2546 [inline] __sys_sendmsg+0x284/0x370 net/socket.c:2575 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f980f689109 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:00007f981088a168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f980f79bf60 RCX: 00007f980f689109 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000004 RBP: 00007f981088a1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007ffd6e6e3c8f R14: 00007f981088a300 R15: 0000000000022000 nbd: failed to add new device