====================================================== WARNING: possible circular locking dependency detected 6.1.16-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/21084 is trying to acquire lock: ffff888147248920 (&q->queue_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:375 [inline] ffff888147248920 (&q->queue_lock){..-.}-{2:2}, at: throtl_pending_timer_fn+0x10d/0x1be0 block/blk-throttle.c:1193 but task is already holding lock: ffffc90000007bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:41 [inline] ffffc90000007bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: call_timer_fn+0xbd/0x840 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}: lock_acquire+0x23a/0x630 kernel/locking/lockdep.c:5669 del_timer_sync+0x111/0x2e0 kernel/time/timer.c:1417 throtl_pd_free+0x15/0x40 block/blk-throttle.c:493 blkcg_deactivate_policy+0x32d/0x550 block/blk-cgroup.c:1499 blk_throtl_exit+0xa6/0x140 block/blk-throttle.c:2406 disk_release+0x1dd/0x380 block/genhd.c:1171 device_release+0x91/0x1c0 kobject_cleanup lib/kobject.c:681 [inline] kobject_release lib/kobject.c:712 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x224/0x460 lib/kobject.c:729 do_floppy_init+0x373/0xc59 drivers/block/floppy.c:4758 async_run_entry_fn+0xa2/0x410 kernel/async.c:127 process_one_work+0x909/0x1380 kernel/workqueue.c:2289 worker_thread+0xa5f/0x1210 kernel/workqueue.c:2436 kthread+0x268/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 -> #1 (&blkcg->lock){....}-{2:2}: lock_acquire+0x23a/0x630 kernel/locking/lockdep.c:5669 __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+0xa94/0x1280 block/blk-cgroup.c:336 blkcg_init_disk+0xee/0x350 block/blk-cgroup.c:1260 __alloc_disk_node+0x2ce/0x590 block/genhd.c:1385 __blk_alloc_disk+0x2c/0x80 block/genhd.c:1424 brd_alloc+0x2f9/0x6a0 drivers/block/brd.c:397 brd_init+0x100/0x1c2 drivers/block/brd.c:484 do_one_initcall+0x2d6/0xa80 init/main.c:1303 do_initcall_level+0x157/0x207 init/main.c:1376 do_initcalls+0x49/0x86 init/main.c:1392 kernel_init_freeable+0x473/0x61f init/main.c:1631 kernel_init+0x19/0x290 init/main.c:1519 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 -> #0 (&q->queue_lock){..-.}-{2:2}: check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain+0x1667/0x58e0 kernel/locking/lockdep.c:3832 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056 lock_acquire+0x23a/0x630 kernel/locking/lockdep.c:5669 __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:375 [inline] throtl_pending_timer_fn+0x10d/0x1be0 block/blk-throttle.c:1193 call_timer_fn+0x200/0x840 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1790 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803 __do_softirq+0x30d/0xb1b kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x155/0x240 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:1107 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649 put_page_testzero include/linux/mm.h:763 [inline] folio_put_testzero include/linux/mm.h:769 [inline] release_pages+0x33b/0x2b40 mm/swap.c:1013 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline] tlb_flush_mmu_free mm/mmu_gather.c:254 [inline] tlb_flush_mmu+0xfc/0x210 mm/mmu_gather.c:261 zap_pte_range mm/memory.c:1515 [inline] zap_pmd_range mm/memory.c:1564 [inline] zap_pud_range mm/memory.c:1593 [inline] zap_p4d_range mm/memory.c:1614 [inline] unmap_page_range+0x2112/0x26e0 mm/memory.c:1635 unmap_vmas+0x3c4/0x560 mm/memory.c:1720 exit_mmap+0x24d/0x970 mm/mmap.c:3089 __mmput+0x115/0x3c0 kernel/fork.c:1188 exit_mm+0x226/0x300 kernel/exit.c:563 do_exit+0x67e/0x2300 kernel/exit.c:856 do_group_exit+0x202/0x2b0 kernel/exit.c:1019 get_signal+0x16f7/0x17d0 kernel/signal.c:2858 arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x60/0x2d0 kernel/entry/common.c:296 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd 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 syz-executor.0/21084: #0: ffff888022f01f58 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_read_lock include/linux/mmap_lock.h:117 [inline] #0: ffff888022f01f58 (&mm->mmap_lock#2){++++}-{3:3}, at: exit_mmap+0x1c0/0x970 mm/mmap.c:3074 #1: ffffc90000007bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:41 [inline] #1: ffffc90000007bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: call_timer_fn+0xbd/0x840 kernel/time/timer.c:1464 stack backtrace: CPU: 0 PID: 21084 Comm: syz-executor.0 Not tainted 6.1.16-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2fa/0x3b0 kernel/locking/lockdep.c:2178 check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain+0x1667/0x58e0 kernel/locking/lockdep.c:3832 __lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5056 lock_acquire+0x23a/0x630 kernel/locking/lockdep.c:5669 __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:375 [inline] throtl_pending_timer_fn+0x10d/0x1be0 block/blk-throttle.c:1193 call_timer_fn+0x200/0x840 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1790 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803 __do_softirq+0x30d/0xb1b kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x155/0x240 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:1107 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:put_page_testzero include/linux/mm.h:763 [inline] RIP: 0010:folio_put_testzero include/linux/mm.h:769 [inline] RIP: 0010:release_pages+0x33b/0x2b40 mm/swap.c:1013 Code: eb 6a 24 00 4c 89 f8 48 c1 e8 03 0f b6 04 18 84 c0 0f 85 ab 12 00 00 41 8b 1f 31 ff 89 de e8 bc 08 ce ff 85 db 4c 8b 64 24 10 <0f> 84 40 25 00 00 4c 89 ff be 04 00 00 00 e8 c2 6a 24 00 31 db f0 RSP: 0018:ffffc9000c02f160 EFLAGS: 00000202 RAX: 0000000000000000 RBX: 0000000000000004 RCX: ffffffff81bc5ba5 RDX: ffff88807db21d40 RSI: 0000000000000004 RDI: 0000000000000000 RBP: ffffc9000c02f2e0 R08: ffffffff81bc5bc4 R09: fffff940003b69ff R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000159 R13: 0000000000000000 R14: ffffea0001db4fc0 R15: ffffea0001db4ff4 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline] tlb_flush_mmu_free mm/mmu_gather.c:254 [inline] tlb_flush_mmu+0xfc/0x210 mm/mmu_gather.c:261 zap_pte_range mm/memory.c:1515 [inline] zap_pmd_range mm/memory.c:1564 [inline] zap_pud_range mm/memory.c:1593 [inline] zap_p4d_range mm/memory.c:1614 [inline] unmap_page_range+0x2112/0x26e0 mm/memory.c:1635 unmap_vmas+0x3c4/0x560 mm/memory.c:1720 exit_mmap+0x24d/0x970 mm/mmap.c:3089 __mmput+0x115/0x3c0 kernel/fork.c:1188 exit_mm+0x226/0x300 kernel/exit.c:563 do_exit+0x67e/0x2300 kernel/exit.c:856 do_group_exit+0x202/0x2b0 kernel/exit.c:1019 get_signal+0x16f7/0x17d0 kernel/signal.c:2858 arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x60/0x2d0 kernel/entry/common.c:296 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f218428c0f9 Code: Unable to access opcode bytes at 0x7f218428c0cf. RSP: 002b:00007f2184f45218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007f21843abf88 RCX: 00007f218428c0f9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f21843abf88 RBP: 00007f21843abf80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f21843abf8c R13: 00007ffe980af41f R14: 00007f2184f45300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: eb 6a jmp 0x6c 2: 24 00 and $0x0,%al 4: 4c 89 f8 mov %r15,%rax 7: 48 c1 e8 03 shr $0x3,%rax b: 0f b6 04 18 movzbl (%rax,%rbx,1),%eax f: 84 c0 test %al,%al 11: 0f 85 ab 12 00 00 jne 0x12c2 17: 41 8b 1f mov (%r15),%ebx 1a: 31 ff xor %edi,%edi 1c: 89 de mov %ebx,%esi 1e: e8 bc 08 ce ff callq 0xffce08df 23: 85 db test %ebx,%ebx 25: 4c 8b 64 24 10 mov 0x10(%rsp),%r12 * 2a: 0f 84 40 25 00 00 je 0x2570 <-- trapping instruction 30: 4c 89 ff mov %r15,%rdi 33: be 04 00 00 00 mov $0x4,%esi 38: e8 c2 6a 24 00 callq 0x246aff 3d: 31 db xor %ebx,%ebx 3f: f0 lock