loop7: detected capacity change from 0 to 8192 ====================================================== WARNING: possible circular locking dependency detected 6.13.0-rc3-syzkaller-00044-gaef25be35d23 #0 Not tainted ------------------------------------------------------ syz.7.1445/11533 is trying to acquire lock: ffff8880797c1ba8 (&sb->s_type->i_mutex_key#30){++++}-{4:4}, at: inode_lock include/linux/fs.h:818 [inline] ffff8880797c1ba8 (&sb->s_type->i_mutex_key#30){++++}-{4:4}, at: __generic_file_fsync+0x97/0x1a0 fs/libfs.c:1536 but task is already holding lock: ffff888142b5a7c8 (&q->q_usage_counter(io)#26){++++}-{0:0}, at: loop_set_status+0x1e4/0x8f0 drivers/block/loop.c:1267 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&q->q_usage_counter(io)#26){++++}-{0:0}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849 bio_queue_enter block/blk.h:75 [inline] blk_mq_submit_bio+0x1536/0x2390 block/blk-mq.c:3090 __submit_bio+0x2c6/0x560 block/blk-core.c:629 __submit_bio_noacct_mq block/blk-core.c:710 [inline] submit_bio_noacct_nocheck+0x4d3/0xe30 block/blk-core.c:739 dio_bio_submit fs/direct-io.c:442 [inline] dio_send_cur_page+0x30f/0x760 fs/direct-io.c:746 submit_page_section+0x124/0xa60 fs/direct-io.c:815 do_direct_IO fs/direct-io.c:1030 [inline] __blockdev_direct_IO+0x25ed/0x4890 fs/direct-io.c:1243 blockdev_direct_IO include/linux/fs.h:3313 [inline] fat_direct_IO+0x1ba/0x300 fs/fat/inode.c:281 generic_file_read_iter+0x343/0x550 mm/filemap.c:2811 aio_read+0x365/0x500 fs/aio.c:1602 io_submit_one+0x884/0x18a0 fs/aio.c:2052 __do_sys_io_submit fs/aio.c:2111 [inline] __se_sys_io_submit+0x171/0x2e0 fs/aio.c:2081 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&sb->s_type->i_mutex_key#30){++++}-{4:4}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5226 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849 down_write+0x99/0x220 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:818 [inline] __generic_file_fsync+0x97/0x1a0 fs/libfs.c:1536 fat_file_fsync+0x7b/0x190 fs/fat/file.c:191 __loop_update_dio+0x1a4/0x500 drivers/block/loop.c:204 loop_set_status+0x62b/0x8f0 drivers/block/loop.c:1289 lo_ioctl+0xcbc/0x1f50 blkdev_ioctl+0x57f/0x6a0 block/ioctl.c:693 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf7/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&q->q_usage_counter(io)#26); lock(&sb->s_type->i_mutex_key#30); lock(&q->q_usage_counter(io)#26); lock(&sb->s_type->i_mutex_key#30); *** DEADLOCK *** 3 locks held by syz.7.1445/11533: #0: ffff88802560eb60 (&lo->lo_mutex){+.+.}-{4:4}, at: loop_set_status+0x2a/0x8f0 drivers/block/loop.c:1251 #1: ffff888142b5a7c8 (&q->q_usage_counter(io)#26){++++}-{0:0}, at: loop_set_status+0x1e4/0x8f0 drivers/block/loop.c:1267 #2: ffff888142b5a800 (&q->q_usage_counter(queue)#10){+.+.}-{0:0}, at: loop_set_status+0x1e4/0x8f0 drivers/block/loop.c:1267 stack backtrace: CPU: 1 UID: 0 PID: 11533 Comm: syz.7.1445 Not tainted 6.13.0-rc3-syzkaller-00044-gaef25be35d23 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2074 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3904 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5226 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5849 down_write+0x99/0x220 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:818 [inline] __generic_file_fsync+0x97/0x1a0 fs/libfs.c:1536 fat_file_fsync+0x7b/0x190 fs/fat/file.c:191 __loop_update_dio+0x1a4/0x500 drivers/block/loop.c:204 loop_set_status+0x62b/0x8f0 drivers/block/loop.c:1289 lo_ioctl+0xcbc/0x1f50 blkdev_ioctl+0x57f/0x6a0 block/ioctl.c:693 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf7/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fda9ff85d29 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdaa0d5b038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fdaa0175fa0 RCX: 00007fda9ff85d29 RDX: 0000000020000480 RSI: 0000000000004c02 RDI: 0000000000000004 RBP: 00007fdaa0001a20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fdaa0175fa0 R15: 00007ffcb3a271b8