======================================================
WARNING: possible circular locking dependency detected
6.1.16-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.0/3770 is trying to acquire lock:
ffff8881475dbb00 (&q->queue_lock){..-.}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:375 [inline]
ffff8881475dbb00 (&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
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
_raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:405 [inline]
__wake_up_common_lock kernel/sched/wait.c:140 [inline]
__wake_up+0x128/0x1c0 kernel/sched/wait.c:160
stop_this_handle+0x3b7/0x5f0 fs/jbd2/transaction.c:751
jbd2_journal_stop+0x980/0xf50 fs/jbd2/transaction.c:1956
__ext4_journal_stop+0xf8/0x190 fs/ext4/ext4_jbd2.c:127
__mark_inode_dirty+0x40f/0x1290 fs/fs-writeback.c:2408
mark_inode_dirty include/linux/fs.h:2481 [inline]
generic_write_end+0x180/0x1d0 fs/buffer.c:2184
ext4_da_write_end+0x82c/0xbb0 fs/ext4/inode.c:3103
generic_perform_write+0x3e9/0x5e0 mm/filemap.c:3765
ext4_buffered_write_iter+0x122/0x3a0 fs/ext4/file.c:285
ext4_file_write_iter+0x1d2/0x18f0
__kernel_write_iter+0x2ff/0x710 fs/read_write.c:517
dump_emit_page fs/coredump.c:881 [inline]
dump_user_range+0x43d/0x8e0 fs/coredump.c:908
elf_core_dump+0x3cff/0x45b0 fs/binfmt_elf.c:2312
do_coredump+0x18b7/0x2700 fs/coredump.c:755
get_signal+0x1454/0x17d0 kernel/signal.c:2844
arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:869
exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:203
irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:309
exc_page_fault+0x5a4/0x860 arch/x86/mm/fault.c:1578
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570
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 ***
4 locks held by syz-executor.0/3770:
#0: ffff88814b9b0460 (sb_writers#4){.+.+}-{0:0}, at: do_coredump+0x1892/0x2700 fs/coredump.c:754
#1: ffff888075162218 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline]
#1: ffff888075162218 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: ext4_buffered_write_iter+0xaf/0x3a0 fs/ext4/file.c:279
#2: ffff88814b9b4990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x13c8/0x1640 fs/jbd2/transaction.c:461
#3: ffffc900001e0bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:41 [inline]
#3: ffffc900001e0bc0 ((&sq->pending_timer)){+.-.}-{0:0}, at: call_timer_fn+0xbd/0x840 kernel/time/timer.c:1464
stack backtrace:
CPU: 1 PID: 3770 Comm: syz-executor.0 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:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0xd4/0x130 kernel/locking/spinlock.c:194
Code: 9c 8f 44 24 20 42 80 3c 23 00 74 08 4c 89 f7 e8 f2 45 4d f7 f6 44 24 21 02 75 4e 41 f7 c7 00 02 00 00 74 01 fb bf 01 00 00 00 d7 df ca f6 65 8b 05 18 f0 6e 75 85 c0 74 3f 48 c7 04 24 0e 36
RSP: 0018:ffffc9000509e940 EFLAGS: 00000206
RAX: 6ff67bcf7b2b8100 RBX: 1ffff92000a13d2c RCX: ffffffff816aaefa
RDX: dffffc0000000000 RSI: ffffffff8aebd320 RDI: 0000000000000001
RBP: ffffc9000509e9d0 R08: dffffc0000000000 R09: fffffbfff204cc45
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: 1ffff92000a13d28 R14: ffffc9000509e960 R15: 0000000000000246
spin_unlock_irqrestore include/linux/spinlock.h:405 [inline]
__wake_up_common_lock kernel/sched/wait.c:140 [inline]
__wake_up+0x128/0x1c0 kernel/sched/wait.c:160
stop_this_handle+0x3b7/0x5f0 fs/jbd2/transaction.c:751
jbd2_journal_stop+0x980/0xf50 fs/jbd2/transaction.c:1956
__ext4_journal_stop+0xf8/0x190 fs/ext4/ext4_jbd2.c:127
__mark_inode_dirty+0x40f/0x1290 fs/fs-writeback.c:2408
mark_inode_dirty include/linux/fs.h:2481 [inline]
generic_write_end+0x180/0x1d0 fs/buffer.c:2184
ext4_da_write_end+0x82c/0xbb0 fs/ext4/inode.c:3103
generic_perform_write+0x3e9/0x5e0 mm/filemap.c:3765
ext4_buffered_write_iter+0x122/0x3a0 fs/ext4/file.c:285
ext4_file_write_iter+0x1d2/0x18f0
__kernel_write_iter+0x2ff/0x710 fs/read_write.c:517
dump_emit_page fs/coredump.c:881 [inline]
dump_user_range+0x43d/0x8e0 fs/coredump.c:908
elf_core_dump+0x3cff/0x45b0 fs/binfmt_elf.c:2312
do_coredump+0x18b7/0x2700 fs/coredump.c:755
get_signal+0x1454/0x17d0 kernel/signal.c:2844
arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:869
exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:203
irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:309
exc_page_fault+0x5a4/0x860 arch/x86/mm/fault.c:1578
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570
RIP: 0033:0x7feb6f627ec7
Code: 38 5d 41 5c c3 48 8d 3d 5d ea 0b 00 e8 72 f8 ff ff 48 8d 3d 5f ea 0b 00 e8 66 f8 ff ff 66 0f 1f 44 00 00 55 89 fd 48 83 ec 10 <64> 8b 04 25 b4 ff ff ff 85 c0 74 2a 89 fe 31 c0 bf 3c 00 00 00 e8
RSP: 002b:00007feb703bf260 EFLAGS: 00010206
RAX: 0000000000000000 RBX: 00007feb6f7abf80 RCX: 00007feb6f68c0f9
RDX: 00007feb703bf280 RSI: 00007feb703bf3b0 RDI: 000000000000000b
RBP: 000000000000000b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
R13: 00007ffd4eeb682f R14: 00007feb703de300 R15: 0000000000022000
----------------
Code disassembly (best guess):
0: 9c pushfq
1: 8f 44 24 20 popq 0x20(%rsp)
5: 42 80 3c 23 00 cmpb $0x0,(%rbx,%r12,1)
a: 74 08 je 0x14
c: 4c 89 f7 mov %r14,%rdi
f: e8 f2 45 4d f7 callq 0xf74d4606
14: f6 44 24 21 02 testb $0x2,0x21(%rsp)
19: 75 4e jne 0x69
1b: 41 f7 c7 00 02 00 00 test $0x200,%r15d
22: 74 01 je 0x25
24: fb sti
25: bf 01 00 00 00 mov $0x1,%edi
* 2a: e8 d7 df ca f6 callq 0xf6cae006 <-- trapping instruction
2f: 65 8b 05 18 f0 6e 75 mov %gs:0x756ef018(%rip),%eax # 0x756ef04e
36: 85 c0 test %eax,%eax
38: 74 3f je 0x79
3a: 48 rex.W
3b: c7 .byte 0xc7
3c: 04 24 add $0x24,%al
3e: 0e (bad)
3f: 36 ss