======================================================
WARNING: possible circular locking dependency detected
6.1.16-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.4/9574 is trying to acquire lock:
ffff88801f96d3f0 (&q->queue_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:375 [inline]
ffff88801f96d3f0 (&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_mq_alloc_disk+0x11e/0x1e0 block/blk-mq.c:4081
floppy_alloc_disk+0x54/0x360 drivers/block/floppy.c:4514
do_floppy_init+0x1af/0xc59 drivers/block/floppy.c:4595
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
-> #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
__sanitizer_cov_trace_pc+0x0/0x60
__dentry_kill+0x149/0x650 fs/dcache.c:597
dentry_kill+0xbb/0x290
dput+0x1ef/0x420 fs/dcache.c:913
find_next_child fs/libfs.c:265 [inline]
simple_recursive_removal+0x263/0x850 fs/libfs.c:280
debugfs_remove+0x45/0x60 fs/debugfs/inode.c:765
blk_unregister_queue+0x199/0x1d0 block/blk-sysfs.c:932
del_gendisk+0x3bb/0x860 block/genhd.c:632
loop_remove drivers/block/loop.c:2073 [inline]
loop_control_remove drivers/block/loop.c:2128 [inline]
loop_control_ioctl+0x5c6/0x770 drivers/block/loop.c:2166
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 ***
6 locks held by syz-executor.4/9574:
#0: ffff8881472a3980 (&q->debugfs_mutex){+.+.}-{3:3}, at: blk_unregister_queue+0x16c/0x1d0 block/blk-sysfs.c:930
#1: ffff888140db5fb0 (&sb->s_type->i_mutex_key#3){++++}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline]
#1: ffff888140db5fb0 (&sb->s_type->i_mutex_key#3){++++}-{3:3}, at: simple_recursive_removal+0x339/0x850 fs/libfs.c:289
#2: ffff888140c176b0 (&dentry->d_lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:350 [inline]
#2: ffff888140c176b0 (&dentry->d_lock){+.+.}-{2:2}, at: lockref_put_or_lock+0x22/0xb0 lib/lockref.c:147
#3: ffff888140db6e30 (&sb->s_type->i_lock_key#7){+.+.}-{2:2}, at: spin_trylock include/linux/spinlock.h:360 [inline]
#3: ffff888140db6e30 (&sb->s_type->i_lock_key#7){+.+.}-{2:2}, at: dentry_kill+0x4c/0x290 fs/dcache.c:717
#4: ffff888140c17248 (&dentry->d_lock){+.+.}-{2:2}, at: spin_trylock include/linux/spinlock.h:360 [inline]
#4: ffff888140c17248 (&dentry->d_lock){+.+.}-{2:2}, at: dentry_kill+0x95/0x290 fs/dcache.c:722
#5: ffffc90000007bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:41 [inline]
#5: ffffc90000007bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: call_timer_fn+0xbd/0x840 kernel/time/timer.c:1464
stack backtrace:
CPU: 0 PID: 9574 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:__sanitizer_cov_trace_pc+0x0/0x60 kernel/kcov.c:203
Code: e8 25 00 00 00 0f 0b 0f 1f 00 53 48 89 fb e8 17 00 00 00 48 8b 3d 48 3d c8 0c 48 89 de 5b e9 d7 91 55 00 cc cc cc cc cc cc cc <48> 8b 04 24 65 48 8b 0d 14 0e 78 7e 65 8b 15 15 0e 78 7e f7 c2 00
RSP: 0018:ffffc9000b3cfc20 EFLAGS: 00000287
RAX: 0000000000000002 RBX: 0000000000000000 RCX: 0000000000040000
RDX: ffff888026eed7c0 RSI: 0000000000000000 RDI: 0000000000080000
RBP: 0000000000000001 R08: ffffffff81f586d2 R09: ffffed1028182ed4
R10: 0000000000000000 R11: dffffc0000000001 R12: ffff888140c17608
R13: dffffc0000000000 R14: ffff888140c17698 R15: 1ffff11028182ec1
__dentry_kill+0x149/0x650 fs/dcache.c:597
dentry_kill+0xbb/0x290
dput+0x1ef/0x420 fs/dcache.c:913
find_next_child fs/libfs.c:265 [inline]
simple_recursive_removal+0x263/0x850 fs/libfs.c:280
debugfs_remove+0x45/0x60 fs/debugfs/inode.c:765
blk_unregister_queue+0x199/0x1d0 block/blk-sysfs.c:932
del_gendisk+0x3bb/0x860 block/genhd.c:632
loop_remove drivers/block/loop.c:2073 [inline]
loop_control_remove drivers/block/loop.c:2128 [inline]
loop_control_ioctl+0x5c6/0x770 drivers/block/loop.c:2166
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:0x7f1ab5e8c0f9
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:00007f1ab6c71168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f1ab5fac050 RCX: 00007f1ab5e8c0f9
RDX: 0000000000000001 RSI: 0000000000004c81 RDI: 0000000000000003
RBP: 00007f1ab5ee7ae9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd632676af R14: 00007f1ab6c71300 R15: 0000000000022000
----------------
Code disassembly (best guess):
0: e8 25 00 00 00 callq 0x2a
5: 0f 0b ud2
7: 0f 1f 00 nopl (%rax)
a: 53 push %rbx
b: 48 89 fb mov %rdi,%rbx
e: e8 17 00 00 00 callq 0x2a
13: 48 8b 3d 48 3d c8 0c mov 0xcc83d48(%rip),%rdi # 0xcc83d62
1a: 48 89 de mov %rbx,%rsi
1d: 5b pop %rbx
1e: e9 d7 91 55 00 jmpq 0x5591fa
23: cc int3
24: cc int3
25: cc int3
26: cc int3
27: cc int3
28: cc int3
29: cc int3
* 2a: 48 8b 04 24 mov (%rsp),%rax <-- trapping instruction
2e: 65 48 8b 0d 14 0e 78 mov %gs:0x7e780e14(%rip),%rcx # 0x7e780e4a
35: 7e
36: 65 8b 15 15 0e 78 7e mov %gs:0x7e780e15(%rip),%edx # 0x7e780e52
3d: f7 .byte 0xf7
3e: c2 .byte 0xc2