====================================================== WARNING: possible circular locking dependency detected 6.1.16-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/7456 is trying to acquire lock: ffff88814728aa60 (&q->queue_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:375 [inline] ffff88814728aa60 (&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 pvclock_clocksource_read+0xa/0x710 arch/x86/kernel/pvclock.c:68 kvm_clock_read arch/x86/kernel/kvmclock.c:79 [inline] kvm_sched_clock_read+0x14/0x40 arch/x86/kernel/kvmclock.c:91 sched_clock_cpu+0x71/0x2b0 kernel/sched/clock.c:369 local_clock include/linux/sched/clock.h:84 [inline] __set_page_owner_handle mm/page_owner.c:174 [inline] __set_page_owner+0x1cf/0x390 mm/page_owner.c:195 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x3573/0x3700 mm/page_alloc.c:4291 __alloc_pages+0x28d/0x7e0 mm/page_alloc.c:5558 alloc_largest_available drivers/dma-buf/heaps/system_heap.c:327 [inline] system_heap_allocate+0x329/0x1450 drivers/dma-buf/heaps/system_heap.c:372 dma_heap_buffer_alloc drivers/dma-buf/dma-heap.c:67 [inline] dma_heap_ioctl_allocate drivers/dma-buf/dma-heap.c:111 [inline] dma_heap_ioctl+0x454/0x560 drivers/dma-buf/dma-heap.c:171 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856 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.4/7456: #0: ffffffff8cf272a0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:305 #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: 7456 Comm: syz-executor.4 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:pvclock_clocksource_read+0xa/0x710 arch/x86/kernel/pvclock.c:68 Code: 0d 44 89 e0 48 83 c4 18 5b 41 5c 41 5d 41 5e 41 5f 5d c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 55 41 57 41 56 41 55 41 54 53 <48> 83 ec 70 49 89 f8 49 bf 00 00 00 00 00 fc ff df 4c 8d 4f 08 4c RSP: 0018:ffffc9000388f6c0 EFLAGS: 00000282 RAX: f3f3f300f1f1f1f1 RBX: ffff88801424bd80 RCX: 0000000000040000 RDX: ffffc9000c793000 RSI: 00000000000087e0 RDI: ffffffff8fc69040 RBP: ffffc9000388f7d0 R08: dffffc0000000000 R09: ffffed10028497a9 R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc9000388f760 R13: dffffc0000000000 R14: 1ffff92000711ee8 R15: ffff888025e78000 kvm_clock_read arch/x86/kernel/kvmclock.c:79 [inline] kvm_sched_clock_read+0x14/0x40 arch/x86/kernel/kvmclock.c:91 sched_clock_cpu+0x71/0x2b0 kernel/sched/clock.c:369 local_clock include/linux/sched/clock.h:84 [inline] __set_page_owner_handle mm/page_owner.c:174 [inline] __set_page_owner+0x1cf/0x390 mm/page_owner.c:195 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x3573/0x3700 mm/page_alloc.c:4291 __alloc_pages+0x28d/0x7e0 mm/page_alloc.c:5558 alloc_largest_available drivers/dma-buf/heaps/system_heap.c:327 [inline] system_heap_allocate+0x329/0x1450 drivers/dma-buf/heaps/system_heap.c:372 dma_heap_buffer_alloc drivers/dma-buf/dma-heap.c:67 [inline] dma_heap_ioctl_allocate drivers/dma-buf/dma-heap.c:111 [inline] dma_heap_ioctl+0x454/0x560 drivers/dma-buf/dma-heap.c:171 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856 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:0x7f556c68c0f9 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:00007f556d4a7168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f556c7abf80 RCX: 00007f556c68c0f9 RDX: 0000000020000100 RSI: 0000000040085400 RDI: 0000000000000006 RBP: 00007f556c6e7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff6da0669f R14: 00007f556d4a7300 R15: 0000000000022000 ---------------- Code disassembly (best guess): 0: 0d 44 89 e0 48 or $0x48e08944,%eax 5: 83 c4 18 add $0x18,%esp 8: 5b pop %rbx 9: 41 5c pop %r12 b: 41 5d pop %r13 d: 41 5e pop %r14 f: 41 5f pop %r15 11: 5d pop %rbp 12: c3 retq 13: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 1a: 00 00 00 1d: 0f 1f 00 nopl (%rax) 20: 55 push %rbp 21: 41 57 push %r15 23: 41 56 push %r14 25: 41 55 push %r13 27: 41 54 push %r12 29: 53 push %rbx * 2a: 48 83 ec 70 sub $0x70,%rsp <-- trapping instruction 2e: 49 89 f8 mov %rdi,%r8 31: 49 bf 00 00 00 00 00 movabs $0xdffffc0000000000,%r15 38: fc ff df 3b: 4c 8d 4f 08 lea 0x8(%rdi),%r9 3f: 4c rex.WR