====================================================== WARNING: possible circular locking dependency detected 6.0.0-rc6-syzkaller-00009-g60891ec99e14 #0 Not tainted ------------------------------------------------------ syz-executor.5/15100 is trying to acquire lock: ffff88803c6f40a8 ((&sq->pending_timer)){+.-.}-{0:0}, at: del_timer_sync+0xf5/0x2e0 kernel/time/timer.c:1417 but task is already holding lock: ffffffff919a4c30 (&blkcg->lock){....}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] ffffffff919a4c30 (&blkcg->lock){....}-{2:2}, at: blkcg_deactivate_policy+0x1ab/0x540 block/blk-cgroup.c:1519 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&blkcg->lock){....}-{2:2}: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666 __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:349 [inline] blkg_create+0x949/0x10a0 block/blk-cgroup.c:344 blkcg_init_queue+0xb9/0x300 block/blk-cgroup.c:1285 __alloc_disk_node+0x2ce/0x590 block/genhd.c:1366 __blk_mq_alloc_disk+0x11b/0x1e0 block/blk-mq.c:3942 floppy_alloc_disk+0x54/0x350 drivers/block/floppy.c:4514 do_floppy_init+0x1b1/0xc54 drivers/block/floppy.c:4595 async_run_entry_fn+0xa6/0x400 kernel/async.c:127 process_one_work+0x81c/0xd10 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 -> #1 (&q->queue_lock){..-.}-{2:2}: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666 __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:374 [inline] throtl_pending_timer_fn+0xe9/0xfb0 block/blk-throttle.c:1152 call_timer_fn+0xf5/0x210 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers+0x76a/0x980 kernel/time/timer.c:1790 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803 __do_softirq+0x382/0x793 kernel/softirq.c:571 __irq_exit_rcu+0xec/0x170 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:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 console_emit_next_record+0x8b6/0xa60 kernel/printk/printk.c:2704 console_unlock+0x26b/0x6f0 kernel/printk/printk.c:2861 do_con_write+0x76cb/0x77b0 drivers/tty/vt/vt.c:2965 con_write+0x28/0x640 drivers/tty/vt/vt.c:3295 process_output_block drivers/tty/n_tty.c:586 [inline] n_tty_write+0xdc0/0x12e0 drivers/tty/n_tty.c:2350 do_tty_write drivers/tty/tty_io.c:1024 [inline] file_tty_write+0x5a5/0x960 drivers/tty/tty_io.c:1095 call_write_iter include/linux/fs.h:2187 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x7b5/0xbb0 fs/read_write.c:578 ksys_write+0x19b/0x2c0 fs/read_write.c:631 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 ((&sq->pending_timer)){+.-.}-{0:0}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain+0x1872/0x6600 kernel/locking/lockdep.c:3829 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5053 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666 del_timer_sync+0x111/0x2e0 kernel/time/timer.c:1417 throtl_pd_free+0x15/0x40 block/blk-throttle.c:500 blkcg_deactivate_policy+0x328/0x540 block/blk-cgroup.c:1523 blk_throtl_exit+0x86/0x120 block/blk-throttle.c:2337 blkcg_init_queue+0x281/0x300 block/blk-cgroup.c:1304 __alloc_disk_node+0x2ce/0x590 block/genhd.c:1366 __blk_mq_alloc_disk+0x11b/0x1e0 block/blk-mq.c:3942 loop_add+0x325/0x9b0 drivers/block/loop.c:1983 loop_control_ioctl+0x108/0x770 drivers/block/loop.c:2155 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Chain exists of: (&sq->pending_timer) --> &q->queue_lock --> &blkcg->lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&blkcg->lock); lock(&q->queue_lock); lock(&blkcg->lock); lock((&sq->pending_timer)); *** DEADLOCK *** 2 locks held by syz-executor.5/15100: #0: ffff8880217dc648 (&q->queue_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:374 [inline] #0: ffff8880217dc648 (&q->queue_lock){..-.}-{2:2}, at: blkcg_deactivate_policy+0xe3/0x540 block/blk-cgroup.c:1512 #1: ffffffff919a4c30 (&blkcg->lock){....}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] #1: ffffffff919a4c30 (&blkcg->lock){....}-{2:2}, at: blkcg_deactivate_policy+0x1ab/0x540 block/blk-cgroup.c:1519 stack backtrace: CPU: 1 PID: 15100 Comm: syz-executor.5 Not tainted 6.0.0-rc6-syzkaller-00009-g60891ec99e14 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2f9/0x3b0 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain+0x1872/0x6600 kernel/locking/lockdep.c:3829 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5053 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666 del_timer_sync+0x111/0x2e0 kernel/time/timer.c:1417 throtl_pd_free+0x15/0x40 block/blk-throttle.c:500 blkcg_deactivate_policy+0x328/0x540 block/blk-cgroup.c:1523 blk_throtl_exit+0x86/0x120 block/blk-throttle.c:2337 blkcg_init_queue+0x281/0x300 block/blk-cgroup.c:1304 __alloc_disk_node+0x2ce/0x590 block/genhd.c:1366 __blk_mq_alloc_disk+0x11b/0x1e0 block/blk-mq.c:3942 loop_add+0x325/0x9b0 drivers/block/loop.c:1983 loop_control_ioctl+0x108/0x770 drivers/block/loop.c:2155 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7ff165089409 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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:00007ff1662ae168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007ff16519c050 RCX: 00007ff165089409 RDX: 0000000000000000 RSI: 0000000000004c80 RDI: 0000000000000005 RBP: 00007ff1662ae1d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007ffd4e29e79f R14: 00007ff1662ae300 R15: 0000000000022000