====================================================== WARNING: possible circular locking dependency detected 6.1.16-syzkaller #0 Not tainted ------------------------------------------------------ modprobe/26364 is trying to acquire lock: ffff8880214a7530 (&q->queue_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:375 [inline] ffff8880214a7530 (&q->queue_lock){..-.}-{2:2}, at: throtl_pending_timer_fn+0x10d/0x1be0 block/blk-throttle.c:1193 but task is already holding lock: ffffc900001e0bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:41 [inline] ffffc900001e0bc0 ((&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 check_preemption_disabled+0x42/0x110 __schedule+0x9e/0x4390 kernel/sched/core.c:6441 preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6863 irqentry_exit+0x53/0x80 kernel/entry/common.c:432 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649 check_region_inline mm/kasan/generic.c:175 [inline] kasan_check_range+0x24/0x290 mm/kasan/generic.c:189 memset+0x1f/0x40 mm/kasan/shadow.c:44 mt_validate+0x1b8/0x57b0 lib/maple_tree.c:7121 validate_mm_mt+0x165/0x670 mm/mmap.c:295 validate_mm+0x16e/0x380 mm/mmap.c:332 do_mas_align_munmap+0x1286/0x1570 mm/mmap.c:2451 do_mas_munmap+0x246/0x2b0 mm/mmap.c:2502 mmap_region+0x8e6/0x1fa0 mm/mmap.c:2550 do_mmap+0x8c5/0xf60 mm/mmap.c:1411 vm_mmap_pgoff+0x1ca/0x2d0 mm/util.c:520 ksys_mmap_pgoff+0x4f5/0x6d0 mm/mmap.c:1457 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/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: &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 modprobe/26364: #0: ffff88801cd67958 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline] #0: ffff88801cd67958 (&mm->mmap_lock#2){++++}-{3:3}, at: vm_mmap_pgoff+0x175/0x2d0 mm/util.c:518 #1: ffffc900001e0bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:41 [inline] #1: ffffc900001e0bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: call_timer_fn+0xbd/0x840 kernel/time/timer.c:1464 stack backtrace: CPU: 1 PID: 26364 Comm: modprobe 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:check_preemption_disabled+0x42/0x110 lib/smp_processor_id.c:55 Code: 08 65 8b 1d c8 41 78 75 65 8b 05 71 97 78 75 a9 ff ff ff 7f 74 22 65 48 8b 04 25 28 00 00 00 48 3b 44 24 08 0f 85 c7 00 00 00 <89> d8 48 83 c4 10 5b 41 5c 41 5e 41 5f c3 48 c7 04 24 00 00 00 00 RSP: 0018:ffffc9000bd96f88 EFLAGS: 00000246 RAX: 44c498e594dced00 RBX: 0000000000000001 RCX: 0000000000000000 RDX: 0000000000000010 RSI: ffffffff8b3d0b80 RDI: ffffffff8b3d0b40 RBP: ffffc9000bd97170 R08: dffffc0000000000 R09: ffffc9000bd97100 R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff920017b2e30 R13: 1ffff920017b2e34 R14: dffffc0000000000 R15: dffffc0000000000 __schedule+0x9e/0x4390 kernel/sched/core.c:6441 preempt_schedule_irq+0xf7/0x1c0 kernel/sched/core.c:6863 irqentry_exit+0x53/0x80 kernel/entry/common.c:432 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:check_region_inline mm/kasan/generic.c:175 [inline] RIP: 0010:kasan_check_range+0x24/0x290 mm/kasan/generic.c:189 Code: cc cc cc cc cc cc 55 41 57 41 56 53 b0 01 48 85 f6 0f 84 9a 01 00 00 48 89 fd 48 01 f5 0f 82 5a 02 00 00 48 89 fd 48 c1 ed 2f <81> fd ff ff 01 00 0f 82 47 02 00 00 48 89 fb 48 c1 eb 03 49 b8 00 RSP: 0018:ffffc9000bd972f8 EFLAGS: 00000a07 RAX: ffffc9000bd97401 RBX: 000000000000000b RCX: ffffffff8a807548 RDX: 0000000000000001 RSI: 000000000000000b RDI: ffffc9000bd974b0 RBP: 000000000001ffff R08: dffffc0000000000 R09: ffffc9000bd97488 R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff920017b2e80 R13: ffffc9000bd97488 R14: 0000000000000000 R15: dffffc0000000000 memset+0x1f/0x40 mm/kasan/shadow.c:44 mt_validate+0x1b8/0x57b0 lib/maple_tree.c:7121 validate_mm_mt+0x165/0x670 mm/mmap.c:295 validate_mm+0x16e/0x380 mm/mmap.c:332 do_mas_align_munmap+0x1286/0x1570 mm/mmap.c:2451 do_mas_munmap+0x246/0x2b0 mm/mmap.c:2502 mmap_region+0x8e6/0x1fa0 mm/mmap.c:2550 do_mmap+0x8c5/0xf60 mm/mmap.c:1411 vm_mmap_pgoff+0x1ca/0x2d0 mm/util.c:520 ksys_mmap_pgoff+0x4f5/0x6d0 mm/mmap.c:1457 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f443668b1f2 Code: 04 00 00 5b 5d 41 5c c3 41 f7 c1 ff 0f 00 00 75 27 55 48 89 fd 53 89 cb 48 85 ff 74 33 41 89 da 48 89 ef b8 09 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 56 5b 5d c3 0f 1f 00 c7 05 9e 1f 01 00 16 00 RSP: 002b:00007ffd008efb58 EFLAGS: 00000206 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 0000000000000812 RCX: 00007f443668b1f2 RDX: 0000000000000005 RSI: 0000000000087000 RDI: 00007f44365b6000 RBP: 00007f44365b6000 R08: 0000000000000000 R09: 000000000000f000 R10: 0000000000000812 R11: 0000000000000206 R12: 00007ffd008efb70 R13: 00007ffd008efba0 R14: 0000000000000005 R15: 00007f4436669000 ---------------- Code disassembly (best guess): 0: 08 65 8b or %ah,-0x75(%rbp) 3: 1d c8 41 78 75 sbb $0x757841c8,%eax 8: 65 8b 05 71 97 78 75 mov %gs:0x75789771(%rip),%eax # 0x75789780 f: a9 ff ff ff 7f test $0x7fffffff,%eax 14: 74 22 je 0x38 16: 65 48 8b 04 25 28 00 mov %gs:0x28,%rax 1d: 00 00 1f: 48 3b 44 24 08 cmp 0x8(%rsp),%rax 24: 0f 85 c7 00 00 00 jne 0xf1 * 2a: 89 d8 mov %ebx,%eax <-- trapping instruction 2c: 48 83 c4 10 add $0x10,%rsp 30: 5b pop %rbx 31: 41 5c pop %r12 33: 41 5e pop %r14 35: 41 5f pop %r15 37: c3 retq 38: 48 c7 04 24 00 00 00 movq $0x0,(%rsp) 3f: 00