====================================================== WARNING: possible circular locking dependency detected 6.1.16-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/9168 is trying to acquire lock: ffff88801fa653f0 (&q->queue_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:375 [inline] ffff88801fa653f0 (&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 memset_erms+0x9/0x10 arch/x86/lib/memset_64.S:63 kasan_save_stack mm/kasan/common.c:42 [inline] kasan_set_track+0x3c/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook mm/slub.c:1750 [inline] slab_free mm/slub.c:3661 [inline] kmem_cache_free_bulk+0x4fa/0x750 mm/slub.c:3779 mt_free_bulk lib/maple_tree.c:163 [inline] mas_destroy+0x2497/0x2dd0 lib/maple_tree.c:5769 mas_store_prealloc+0x34a/0x450 lib/maple_tree.c:5703 do_mas_align_munmap+0xd41/0x1570 mm/mmap.c:2428 do_mas_munmap+0x246/0x2b0 mm/mmap.c:2502 __vm_munmap+0x268/0x370 mm/mmap.c:2779 __do_sys_munmap mm/mmap.c:2804 [inline] __se_sys_munmap mm/mmap.c:2801 [inline] __x64_sys_munmap+0x5c/0x70 mm/mmap.c:2801 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 syz-executor.5/9168: #0: ffff8880221e53d8 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_write_lock_killable include/linux/mmap_lock.h:87 [inline] #0: ffff8880221e53d8 (&mm->mmap_lock#2){++++}-{3:3}, at: __vm_munmap+0x21d/0x370 mm/mmap.c:2776 #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: 9168 Comm: syz-executor.5 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:memset_erms+0x9/0x10 arch/x86/lib/memset_64.S:64 Code: c1 e9 03 40 0f b6 f6 48 b8 01 01 01 01 01 01 01 01 48 0f af c6 f3 48 ab 89 d1 f3 aa 4c 89 c8 c3 90 49 89 f9 40 88 f0 48 89 d1 aa 4c 89 c8 c3 90 49 89 fa 40 0f b6 ce 48 b8 01 01 01 01 01 01 RSP: 0018:ffffc9000368f368 EFLAGS: 00010202 RAX: 0000000000002300 RBX: ffff88807f67c008 RCX: 0000000000000180 RDX: 0000000000000200 RSI: 0000000000000000 RDI: ffffc9000368f3f0 RBP: ffffc9000368f5a0 R08: dffffc0000000000 R09: ffffc9000368f370 R10: 0000000000000006 R11: dffffc0000000001 R12: 0000000000000000 R13: ffffffff8a7fb427 R14: 0000000000000800 R15: ffffc9000368f370 kasan_save_stack mm/kasan/common.c:42 [inline] kasan_set_track+0x3c/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook mm/slub.c:1750 [inline] slab_free mm/slub.c:3661 [inline] kmem_cache_free_bulk+0x4fa/0x750 mm/slub.c:3779 mt_free_bulk lib/maple_tree.c:163 [inline] mas_destroy+0x2497/0x2dd0 lib/maple_tree.c:5769 mas_store_prealloc+0x34a/0x450 lib/maple_tree.c:5703 do_mas_align_munmap+0xd41/0x1570 mm/mmap.c:2428 do_mas_munmap+0x246/0x2b0 mm/mmap.c:2502 __vm_munmap+0x268/0x370 mm/mmap.c:2779 __do_sys_munmap mm/mmap.c:2804 [inline] __se_sys_munmap mm/mmap.c:2801 [inline] __x64_sys_munmap+0x5c/0x70 mm/mmap.c:2801 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:0x7f488b48c1d7 Code: 00 00 00 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb 85 66 2e 0f 1f 84 00 00 00 00 00 90 b8 0b 00 00 00 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:00007f488c240f38 EFLAGS: 00000246 ORIG_RAX: 000000000000000b RAX: ffffffffffffffda RBX: 000000000000000d RCX: 00007f488b48c1d7 RDX: 0000000000020000 RSI: 0000000000020000 RDI: 00007f48819ff000 RBP: 00007f48819ff000 R08: 0000000000000000 R09: 00000000000014dc R10: 0000000000020000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f488c240fdc R14: 00007f488c240fe0 R15: 0000000020002a82 ---------------- Code disassembly (best guess): 0: c1 e9 03 shr $0x3,%ecx 3: 40 0f b6 f6 movzbl %sil,%esi 7: 48 b8 01 01 01 01 01 movabs $0x101010101010101,%rax e: 01 01 01 11: 48 0f af c6 imul %rsi,%rax 15: f3 48 ab rep stos %rax,%es:(%rdi) 18: 89 d1 mov %edx,%ecx 1a: f3 aa rep stos %al,%es:(%rdi) 1c: 4c 89 c8 mov %r9,%rax 1f: c3 retq 20: 90 nop 21: 49 89 f9 mov %rdi,%r9 24: 40 88 f0 mov %sil,%al 27: 48 89 d1 mov %rdx,%rcx * 2a: f3 aa rep stos %al,%es:(%rdi) <-- trapping instruction 2c: 4c 89 c8 mov %r9,%rax 2f: c3 retq 30: 90 nop 31: 49 89 fa mov %rdi,%r10 34: 40 0f b6 ce movzbl %sil,%ecx 38: 48 rex.W 39: b8 01 01 01 01 mov $0x1010101,%eax 3e: 01 01 add %eax,(%rcx)