====================================================== WARNING: possible circular locking dependency detected 6.1.16-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/6053 is trying to acquire lock: ffff88801f378920 (&q->queue_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:375 [inline] ffff88801f378920 (&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 unwind_next_frame+0xb7/0x2220 arch/x86/kernel/unwind_orc.c:433 __unwind_start+0x59d/0x720 arch/x86/kernel/unwind_orc.c:717 unwind_start arch/x86/include/asm/unwind.h:64 [inline] arch_stack_walk+0xdb/0x140 arch/x86/kernel/stacktrace.c:24 stack_trace_save+0x113/0x1c0 kernel/stacktrace.c:122 kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc_node_track_caller+0xad/0x190 mm/slab_common.c:975 __do_krealloc mm/slab_common.c:1348 [inline] krealloc+0x61/0xf0 mm/slab_common.c:1381 copy_array kernel/bpf/verifier.c:1014 [inline] copy_verifier_state+0xde/0xc70 kernel/bpf/verifier.c:1198 is_state_visited kernel/bpf/verifier.c:12115 [inline] do_check+0x2dc6/0xd5d0 kernel/bpf/verifier.c:12230 do_check_common+0x866/0x1040 kernel/bpf/verifier.c:14701 do_check_main kernel/bpf/verifier.c:14764 [inline] bpf_check+0x6308/0x15e70 kernel/bpf/verifier.c:15334 bpf_prog_load+0x12df/0x1bb0 kernel/bpf/syscall.c:2603 __sys_bpf+0x382/0x6c0 kernel/bpf/syscall.c:4963 __do_sys_bpf kernel/bpf/syscall.c:5067 [inline] __se_sys_bpf kernel/bpf/syscall.c:5065 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5065 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 *** 1 lock held by syz-executor.5/6053: #0: ffffc90000007bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:41 [inline] #0: ffffc90000007bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: call_timer_fn+0xbd/0x840 kernel/time/timer.c:1464 stack backtrace: CPU: 0 PID: 6053 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:unwind_next_frame+0xb7/0x2220 arch/x86/kernel/unwind_orc.c:436 Code: 89 84 24 9c 00 00 00 48 89 8c 24 a0 00 00 00 4c 89 bc 24 80 00 00 00 48 89 6c 24 28 bf 01 00 00 00 e8 9d 97 21 00 48 89 1c 24 <48> 83 c3 50 48 89 d8 48 c1 e8 03 48 89 44 24 40 42 80 3c 30 00 74 RSP: 0018:ffffc90003516880 EFLAGS: 00000246 RAX: 1ffff11004b1b9d9 RBX: ffffc900035169c0 RCX: ffffffff8a93ad00 RDX: dffffc0000000000 RSI: ffffc90003510000 RDI: ffffffff813cc5e3 RBP: 1ffff920006a2d38 R08: ffffc900035169b0 R09: ffffc90003516a10 R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff920006a2d3a R13: ffffc900035169d0 R14: dffffc0000000000 R15: ffffffff8133cdeb __unwind_start+0x59d/0x720 arch/x86/kernel/unwind_orc.c:717 unwind_start arch/x86/include/asm/unwind.h:64 [inline] arch_stack_walk+0xdb/0x140 arch/x86/kernel/stacktrace.c:24 stack_trace_save+0x113/0x1c0 kernel/stacktrace.c:122 kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc_node_track_caller+0xad/0x190 mm/slab_common.c:975 __do_krealloc mm/slab_common.c:1348 [inline] krealloc+0x61/0xf0 mm/slab_common.c:1381 copy_array kernel/bpf/verifier.c:1014 [inline] copy_verifier_state+0xde/0xc70 kernel/bpf/verifier.c:1198 is_state_visited kernel/bpf/verifier.c:12115 [inline] do_check+0x2dc6/0xd5d0 kernel/bpf/verifier.c:12230 do_check_common+0x866/0x1040 kernel/bpf/verifier.c:14701 do_check_main kernel/bpf/verifier.c:14764 [inline] bpf_check+0x6308/0x15e70 kernel/bpf/verifier.c:15334 bpf_prog_load+0x12df/0x1bb0 kernel/bpf/syscall.c:2603 __sys_bpf+0x382/0x6c0 kernel/bpf/syscall.c:4963 __do_sys_bpf kernel/bpf/syscall.c:5067 [inline] __se_sys_bpf kernel/bpf/syscall.c:5065 [inline] __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5065 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:0x7fdb3888c0f9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 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:00007fdb39571168 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007fdb389ac1f0 RCX: 00007fdb3888c0f9 RDX: 0000000000000078 RSI: 0000000020000300 RDI: 0000000000000005 RBP: 00007fdb388e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffee564550f R14: 00007fdb39571300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: 89 84 24 9c 00 00 00 mov %eax,0x9c(%rsp) 7: 48 89 8c 24 a0 00 00 mov %rcx,0xa0(%rsp) e: 00 f: 4c 89 bc 24 80 00 00 mov %r15,0x80(%rsp) 16: 00 17: 48 89 6c 24 28 mov %rbp,0x28(%rsp) 1c: bf 01 00 00 00 mov $0x1,%edi 21: e8 9d 97 21 00 callq 0x2197c3 26: 48 89 1c 24 mov %rbx,(%rsp) * 2a: 48 83 c3 50 add $0x50,%rbx <-- trapping instruction 2e: 48 89 d8 mov %rbx,%rax 31: 48 c1 e8 03 shr $0x3,%rax 35: 48 89 44 24 40 mov %rax,0x40(%rsp) 3a: 42 80 3c 30 00 cmpb $0x0,(%rax,%r14,1) 3f: 74 .byte 0x74