R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002
R13: 00007fff3537c53f R14: 00007f45e0288300 R15: 0000000000022000
======================================================
WARNING: possible circular locking dependency detected
6.12.0-rc5-next-20241104 #1 Not tainted
------------------------------------------------------
syz-executor.2/14045 is trying to acquire lock:
ffff888015884460 (&mm->mmap_lock){++++}-{4:4}, at: __might_fault+0xe0/0x190
but task is already holding lock:
ffff88800eb6d5a8 (&q->debugfs_mutex){+.+.}-{4:4}, at: blk_trace_setup+0x33/0x70
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #3 (&q->debugfs_mutex){+.+.}-{4:4}:
__mutex_lock+0x13d/0xac0
blk_mq_init_sched+0x429/0x670
elevator_init_mq+0x299/0x3d0
add_disk_fwnode+0x113/0x1310
sd_probe+0xa82/0xf20
really_probe+0x240/0x820
__driver_probe_device+0x2c4/0x380
driver_probe_device+0x4e/0x2a0
__device_attach_driver+0x1d4/0x390
bus_for_each_drv+0x14c/0x1d0
__device_attach_async_helper+0x1d1/0x260
async_run_entry_fn+0x91/0x290
process_one_work+0x8ee/0x1a00
worker_thread+0x674/0xe70
kthread+0x2c2/0x3a0
ret_from_fork+0x48/0x80
ret_from_fork_asm+0x1a/0x30
-> #2 (&q->q_usage_counter(io)){++++}-{0:0}:
blk_mq_submit_bio+0x1faa/0x26a0
loop5: detected capacity change from 0 to 2048
__submit_bio+0x175/0x480
submit_bio_noacct_nocheck+0x641/0xcc0
loop7: detected capacity change from 0 to 2048
submit_bio_noacct+0x3b3/0x13b0
ext4_bio_write_folio+0x863/0x1300
mpage_submit_folio+0x194/0x270
mpage_process_page_bufs+0x5fb/0x820
mpage_prepare_extent_to_map+0xc75/0x1280
ext4_do_writepages+0x1255/0x30d0
ext4_writepages+0x2f2/0x700
do_writepages+0x1a7/0x810
__writeback_single_inode+0x114/0xdf0
writeback_sb_inodes+0x5b8/0xe40
__writeback_inodes_wb+0xbe/0x270
wb_writeback+0x69e/0xa50
wb_workfn+0x876/0xe50
process_one_work+0x8ee/0x1a00
worker_thread+0x674/0xe70
kthread+0x2c2/0x3a0
ret_from_fork+0x48/0x80
ret_from_fork_asm+0x1a/0x30
-> #1 (jbd2_handle){++++}-{0:0}:
start_this_handle+0xe5a/0x1300
jbd2__journal_start+0x393/0x6b0
__ext4_journal_start_sb+0x183/0x600
ext4_dirty_inode+0xa5/0x130
__mark_inode_dirty+0x1c1/0xd40
generic_update_time+0xcb/0xf0
touch_atime+0x4bb/0x590
ext4_file_mmap+0x1ca/0x250
__mmap_region+0xfa8/0x22b0
mmap_region+0x133/0x300
do_mmap+0xc2c/0x1000
vm_mmap_pgoff+0x1fe/0x390
ksys_mmap_pgoff+0x3d7/0x520
__x64_sys_mmap+0x127/0x190
do_syscall_64+0xbf/0x1d0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #0 (&mm->mmap_lock){++++}-{4:4}:
__lock_acquire+0x2930/0x4430
lock_acquire.part.0+0xeb/0x320
__might_fault+0x110/0x190
_copy_from_user+0x2b/0xd0
__blk_trace_setup+0x96/0x180
blk_trace_setup+0x47/0x70
sg_ioctl+0x69f/0x26b0
__x64_sys_ioctl+0x1a0/0x210
do_syscall_64+0xbf/0x1d0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
other info that might help us debug this:
Chain exists of:
&mm->mmap_lock --> &q->q_usage_counter(io) --> &q->debugfs_mutex
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&q->debugfs_mutex);
lock(&q->q_usage_counter(io));
lock(&q->debugfs_mutex);
rlock(&mm->mmap_lock);
*** DEADLOCK ***
1 lock held by syz-executor.2/14045:
#0: ffff88800eb6d5a8 (&q->debugfs_mutex){+.+.}-{4:4}, at: blk_trace_setup+0x33/0x70
stack backtrace:
CPU: 0 UID: 0 PID: 14045 Comm: syz-executor.2 Not tainted 6.12.0-rc5-next-20241104 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
Call Trace:
dump_stack_lvl+0xca/0x120
print_circular_bug+0x53f/0x820
check_noncircular+0x2e9/0x3c0
__lock_acquire+0x2930/0x4430
lock_acquire.part.0+0xeb/0x320
__might_fault+0x110/0x190
_copy_from_user+0x2b/0xd0
__blk_trace_setup+0x96/0x180
blk_trace_setup+0x47/0x70
sg_ioctl+0x69f/0x26b0
__x64_sys_ioctl+0x1a0/0x210
do_syscall_64+0xbf/0x1d0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f41816dab19
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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f417ec50188 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f41817edf60 RCX: 00007f41816dab19
RDX: 0000000020000000 RSI: 00000000c0481273 RDI: 0000000000000003
RBP: 00007f4181734f6d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd287678ef R14: 00007f417ec50300 R15: 0000000000022000
loop6: detected capacity change from 0 to 2048
EXT4-fs warning (device loop7): read_mmp_block:114: Error -117 while reading MMP block 64
EXT4-fs (loop6): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none.
blktrace: Concurrent blktraces are not allowed on sg0
ext4 filesystem being mounted at /syzkaller-testdir772172984/syzkaller.CQfFSu/144/file0 supports timestamps until 2038-01-19 (0x7fffffff)
sg_write: data in/out 209/251 bytes for SCSI command 0x0-- guessing data in;
program syz-executor.1 not setting count and/or reply_len properly
EXT4-fs (loop6): unmounting filesystem 00000000-0000-0000-0000-000000000000.
sg_write: data in/out 209/251 bytes for SCSI command 0x0-- guessing data in;
program syz-executor.1 not setting count and/or reply_len properly
FAULT_INJECTION: forcing a failure.
name fail_usercopy, interval 1, probability 0, space 0, times 0
CPU: 0 UID: 0 PID: 14074 Comm: syz-executor.1 Not tainted 6.12.0-rc5-next-20241104 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
Call Trace:
dump_stack_lvl+0xfa/0x120
should_fail_ex+0x4b1/0x5b0
_copy_from_iter+0x1dd/0x15b0
copy_page_from_iter+0xe3/0x180
bio_copy_from_iter+0x108/0x270
blk_rq_map_user_iov+0xacc/0x11f0
blk_rq_map_user_io+0x1d1/0x200
sg_common_write.constprop.0+0xe53/0x15f0
sg_write.part.0+0x692/0xab0
sg_write+0x86/0xe0
vfs_write+0x2bc/0x10a0
ksys_write+0x122/0x250
do_syscall_64+0xbf/0x1d0
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f45e2d12b19
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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f45e0288188 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f45e2e25f60 RCX: 00007f45e2d12b19
RDX: 0000000000000125 RSI: 0000000020000340 RDI: 0000000000000003
RBP: 00007f45e02881d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002
R13: 00007fff3537c53f R14: 00007f45e0288300 R15: 0000000000022000
loop7: detected capacity change from 0 to 2048
EXT4-fs warning (device loop7): read_mmp_block:114: Error -117 while reading MMP block 64
loop3: detected capacity change from 0 to 2048
loop6: detected capacity change from 0 to 2048
EXT4-fs warning (device loop3): read_mmp_block:114: Error -117 while reading MMP block 64
EXT4-fs (loop6): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none.
ext4 filesystem being mounted at /syzkaller-testdir772172984/syzkaller.CQfFSu/145/file0 supports timestamps until 2038-01-19 (0x7fffffff)
EXT4-fs (loop6): unmounting filesystem 00000000-0000-0000-0000-000000000000.
EXT4-fs warning (device loop5): ext4_multi_mount_protect:332: MMP startup interrupted, failing mount