====================================================== WARNING: possible circular locking dependency detected 5.18.0-syzkaller-12108-g58f9d52ff689 #0 Not tainted ------------------------------------------------------ pr/ttyS0/16 is trying to acquire lock: ffff8881470800d0 (&q->queue_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:374 [inline] ffff8881470800d0 (&q->queue_lock){..-.}-{2:2}, at: throtl_pending_timer_fn+0xf7/0x1690 block/blk-throttle.c:1152 but task is already holding lock: ffffc900001f0d70 ((&sq->pending_timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:31 [inline] ffffc900001f0d70 ((&sq->pending_timer)){+.-.}-{0:0}, at: call_timer_fn+0xd5/0x6b0 kernel/time/timer.c:1464 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 ((&sq->pending_timer)){+.-.}-{0:0}: del_timer_sync+0x5b/0x1b0 kernel/time/timer.c:1417 throtl_pd_free+0x15/0x40 block/blk-throttle.c:500 blkcg_deactivate_policy block/blk-cgroup.c:1519 [inline] blkcg_deactivate_policy+0x2d2/0x4e0 block/blk-cgroup.c:1497 blk_throtl_exit+0x8a/0x1a0 block/blk-throttle.c:2336 blkcg_init_queue+0x19b/0x610 block/blk-cgroup.c:1301 __alloc_disk_node+0x260/0x610 block/genhd.c:1381 __blk_mq_alloc_disk+0x133/0x1c0 block/blk-mq.c:3941 nbd_dev_add+0x3b2/0xc90 drivers/block/nbd.c:1764 nbd_genl_connect+0x11f3/0x1930 drivers/block/nbd.c:1946 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:731 genl_family_rcv_msg net/netlink/genetlink.c:775 [inline] genl_rcv_msg+0x328/0x580 net/netlink/genetlink.c:792 netlink_rcv_skb+0x153/0x420 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+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+0x6eb/0x810 net/socket.c:2492 ___sys_sendmsg+0xf3/0x170 net/socket.c:2546 __sys_sendmsg net/socket.c:2575 [inline] __do_sys_sendmsg net/socket.c:2584 [inline] __se_sys_sendmsg net/socket.c:2582 [inline] __x64_sys_sendmsg+0x132/0x220 net/socket.c:2582 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+0x46/0xb0 -> #1 (&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:349 [inline] blkg_create+0x45e/0x1000 block/blk-cgroup.c:344 blkcg_init_queue+0xb2/0x610 block/blk-cgroup.c:1282 __alloc_disk_node+0x260/0x610 block/genhd.c:1381 __blk_alloc_disk+0x35/0x70 block/genhd.c:1421 brd_alloc.part.0+0x27f/0x7a0 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+0x103/0x650 init/main.c:1295 do_initcall_level init/main.c:1368 [inline] do_initcalls init/main.c:1384 [inline] do_basic_setup init/main.c:1403 [inline] kernel_init_freeable+0x6b1/0x73a init/main.c:1610 kernel_init+0x1a/0x1d0 init/main.c:1499 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 -> #0 (&q->queue_lock){..-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2abe/0x5660 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5665 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630 __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:374 [inline] throtl_pending_timer_fn+0xf7/0x1690 block/blk-throttle.c:1152 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x679/0xa80 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+0x29b/0x9c2 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:1106 asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:649 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0x38/0x70 kernel/locking/spinlock.c:194 spin_unlock_irqrestore include/linux/spinlock.h:404 [inline] serial8250_console_write+0xa23/0xc30 drivers/tty/serial/8250/8250_port.c:3409 call_console_driver kernel/printk/printk.c:2075 [inline] __console_emit_next_record+0x896/0xa60 kernel/printk/printk.c:2916 console_emit_next_record kernel/printk/printk.c:3721 [inline] printk_kthread_func.cold+0x702/0x73d kernel/printk/printk.c:3837 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 other info that might help us debug this: Chain exists of: &q->queue_lock --> &blkcg->lock --> (&sq->pending_timer) Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock((&sq->pending_timer)); lock(&blkcg->lock); lock((&sq->pending_timer)); lock(&q->queue_lock); *** DEADLOCK *** 2 locks held by pr/ttyS0/16: #0: ffffffff8c818100 (&newcon->lock){+.+.}-{3:3}, at: printk_kthread_func.cold+0x57b/0x73d kernel/printk/printk.c:3804 #1: ffffc900001f0d70 ((&sq->pending_timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:31 [inline] #1: ffffc900001f0d70 ((&sq->pending_timer)){+.-.}-{0:0}, at: call_timer_fn+0xd5/0x6b0 kernel/time/timer.c:1464 stack backtrace: CPU: 1 PID: 16 Comm: pr/ttyS0 Not tainted 5.18.0-syzkaller-12108-g58f9d52ff689 #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+0xcd/0x134 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 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 kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x2abe/0x5660 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5665 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5630 __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:374 [inline] throtl_pending_timer_fn+0xf7/0x1690 block/blk-throttle.c:1152 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x679/0xa80 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+0x29b/0x9c2 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:1106 asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x38/0x70 kernel/locking/spinlock.c:194 Code: 74 24 10 e8 9a e5 e4 f7 48 89 ef e8 a2 66 e5 f7 81 e3 00 02 00 00 75 25 9c 58 f6 c4 02 75 2d 48 85 db 74 01 fb bf 01 00 00 00 33 6f d8 f7 65 8b 05 5c f1 88 76 85 c0 74 0a 5b 5d c3 e8 90 52 RSP: 0018:ffffc90000157b70 EFLAGS: 00000206 RAX: 0000000000000006 RBX: 0000000000000200 RCX: 1ffffffff20d0496 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001 RBP: ffffffff91220260 R08: 0000000000000001 R09: ffffffff906818c7 R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000000 R13: ffffffff912202b8 R14: 0000000000000001 R15: ffffffff912202b0 spin_unlock_irqrestore include/linux/spinlock.h:404 [inline] serial8250_console_write+0xa23/0xc30 drivers/tty/serial/8250/8250_port.c:3409 call_console_driver kernel/printk/printk.c:2075 [inline] __console_emit_next_record+0x896/0xa60 kernel/printk/printk.c:2916 console_emit_next_record kernel/printk/printk.c:3721 [inline] printk_kthread_func.cold+0x702/0x73d kernel/printk/printk.c:3837 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 24 10 and $0x10,%al 2: e8 9a e5 e4 f7 callq 0xf7e4e5a1 7: 48 89 ef mov %rbp,%rdi a: e8 a2 66 e5 f7 callq 0xf7e566b1 f: 81 e3 00 02 00 00 and $0x200,%ebx 15: 75 25 jne 0x3c 17: 9c pushfq 18: 58 pop %rax 19: f6 c4 02 test $0x2,%ah 1c: 75 2d jne 0x4b 1e: 48 85 db test %rbx,%rbx 21: 74 01 je 0x24 23: fb sti 24: bf 01 00 00 00 mov $0x1,%edi * 29: e8 33 6f d8 f7 callq 0xf7d86f61 <-- trapping instruction 2e: 65 8b 05 5c f1 88 76 mov %gs:0x7688f15c(%rip),%eax # 0x7688f191 35: 85 c0 test %eax,%eax 37: 74 0a je 0x43 39: 5b pop %rbx 3a: 5d pop %rbp 3b: c3 retq 3c: e8 .byte 0xe8 3d: 90 nop 3e: 52 push %rdx