====================================================== WARNING: possible circular locking dependency detected 6.2.0-syzkaller-13510-gc29214bc8916 #0 Not tainted ------------------------------------------------------ syz-executor.2/23409 is trying to acquire lock: ffff88801b42e3f8 (&journal->j_checkpoint_mutex){+.+.}-{3:3}, at: __jbd2_log_wait_for_space+0x238/0x4b0 fs/jbd2/checkpoint.c:110 but task is already holding lock: ffff88802843de48 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] ffff88802843de48 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: ext4_dio_write_iter fs/ext4/file.c:534 [inline] ffff88802843de48 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: ext4_file_write_iter+0x1081/0x1740 fs/ext4/file.c:708 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&sb->s_type->i_mutex_key#8){++++}-{3:3}: down_read+0x3d/0x50 kernel/locking/rwsem.c:1520 inode_lock_shared include/linux/fs.h:768 [inline] ext4_bmap+0x52/0x470 fs/ext4/inode.c:3242 bmap+0xae/0x120 fs/inode.c:1799 jbd2_journal_bmap+0xac/0x1c0 fs/jbd2/journal.c:976 __jbd2_journal_erase fs/jbd2/journal.c:1788 [inline] jbd2_journal_flush+0x87b/0xc90 fs/jbd2/journal.c:2491 ext4_ioctl_checkpoint fs/ext4/ioctl.c:1079 [inline] __ext4_ioctl+0xb3f/0x4c90 fs/ext4/ioctl.c:1587 ext4_ioctl fs/ext4/ioctl.c:1607 [inline] ext4_compat_ioctl+0xca/0x430 fs/ext4/ioctl.c:1683 __do_compat_sys_ioctl+0x255/0x2b0 fs/ioctl.c:968 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 -> #0 (&journal->j_checkpoint_mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3098 [inline] check_prevs_add kernel/locking/lockdep.c:3217 [inline] validate_chain kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x2ec7/0x5d40 kernel/locking/lockdep.c:5056 lock_acquire kernel/locking/lockdep.c:5669 [inline] lock_acquire+0x1e3/0x670 kernel/locking/lockdep.c:5634 __mutex_lock_common kernel/locking/mutex.c:603 [inline] mutex_lock_io_nested+0x143/0x11a0 kernel/locking/mutex.c:833 __jbd2_log_wait_for_space+0x238/0x4b0 fs/jbd2/checkpoint.c:110 add_transaction_credits+0xa2d/0xb70 fs/jbd2/transaction.c:298 start_this_handle+0x3ae/0x14e0 fs/jbd2/transaction.c:422 jbd2__journal_start+0x39d/0x9d0 fs/jbd2/transaction.c:520 __ext4_journal_start_sb+0x706/0x890 fs/ext4/ext4_jbd2.c:111 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_handle_inode_extension+0x314/0x890 fs/ext4/file.c:344 ext4_dio_write_iter fs/ext4/file.c:604 [inline] ext4_file_write_iter+0x127e/0x1740 fs/ext4/file.c:708 call_write_iter include/linux/fs.h:1851 [inline] do_iter_readv_writev+0x20b/0x3b0 fs/read_write.c:735 do_iter_write+0x182/0x700 fs/read_write.c:861 vfs_iter_write+0x74/0xa0 fs/read_write.c:902 iter_file_splice_write+0x743/0xc80 fs/splice.c:778 do_splice_from fs/splice.c:856 [inline] direct_splice_actor+0x114/0x180 fs/splice.c:1023 splice_direct_to_actor+0x335/0x8a0 fs/splice.c:978 do_splice_direct+0x1ab/0x280 fs/splice.c:1066 do_sendfile+0xb19/0x12c0 fs/read_write.c:1255 __do_compat_sys_sendfile fs/read_write.c:1344 [inline] __se_compat_sys_sendfile fs/read_write.c:1327 [inline] __ia32_compat_sys_sendfile+0x1e1/0x220 fs/read_write.c:1327 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sb->s_type->i_mutex_key#8); lock(&journal->j_checkpoint_mutex); lock(&sb->s_type->i_mutex_key#8); lock(&journal->j_checkpoint_mutex); *** DEADLOCK *** 2 locks held by syz-executor.2/23409: #0: ffff88801b59a460 (sb_writers#4){.+.+}-{0:0}, at: __do_compat_sys_sendfile fs/read_write.c:1344 [inline] #0: ffff88801b59a460 (sb_writers#4){.+.+}-{0:0}, at: __se_compat_sys_sendfile fs/read_write.c:1327 [inline] #0: ffff88801b59a460 (sb_writers#4){.+.+}-{0:0}, at: __ia32_compat_sys_sendfile+0x1e1/0x220 fs/read_write.c:1327 #1: ffff88802843de48 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline] #1: ffff88802843de48 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: ext4_dio_write_iter fs/ext4/file.c:534 [inline] #1: ffff88802843de48 (&sb->s_type->i_mutex_key#8){++++}-{3:3}, at: ext4_file_write_iter+0x1081/0x1740 fs/ext4/file.c:708 stack backtrace: CPU: 0 PID: 23409 Comm: syz-executor.2 Not tainted 6.2.0-syzkaller-13510-gc29214bc8916 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 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 kernel/locking/lockdep.c:3832 [inline] __lock_acquire+0x2ec7/0x5d40 kernel/locking/lockdep.c:5056 lock_acquire kernel/locking/lockdep.c:5669 [inline] lock_acquire+0x1e3/0x670 kernel/locking/lockdep.c:5634 __mutex_lock_common kernel/locking/mutex.c:603 [inline] mutex_lock_io_nested+0x143/0x11a0 kernel/locking/mutex.c:833 __jbd2_log_wait_for_space+0x238/0x4b0 fs/jbd2/checkpoint.c:110 add_transaction_credits+0xa2d/0xb70 fs/jbd2/transaction.c:298 start_this_handle+0x3ae/0x14e0 fs/jbd2/transaction.c:422 jbd2__journal_start+0x39d/0x9d0 fs/jbd2/transaction.c:520 __ext4_journal_start_sb+0x706/0x890 fs/ext4/ext4_jbd2.c:111 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_handle_inode_extension+0x314/0x890 fs/ext4/file.c:344 ext4_dio_write_iter fs/ext4/file.c:604 [inline] ext4_file_write_iter+0x127e/0x1740 fs/ext4/file.c:708 call_write_iter include/linux/fs.h:1851 [inline] do_iter_readv_writev+0x20b/0x3b0 fs/read_write.c:735 do_iter_write+0x182/0x700 fs/read_write.c:861 vfs_iter_write+0x74/0xa0 fs/read_write.c:902 iter_file_splice_write+0x743/0xc80 fs/splice.c:778 do_splice_from fs/splice.c:856 [inline] direct_splice_actor+0x114/0x180 fs/splice.c:1023 splice_direct_to_actor+0x335/0x8a0 fs/splice.c:978 do_splice_direct+0x1ab/0x280 fs/splice.c:1066 do_sendfile+0xb19/0x12c0 fs/read_write.c:1255 __do_compat_sys_sendfile fs/read_write.c:1344 [inline] __se_compat_sys_sendfile fs/read_write.c:1327 [inline] __ia32_compat_sys_sendfile+0x1e1/0x220 fs/read_write.c:1327 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 RIP: 0023:0xf7f27579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f7ee05cc EFLAGS: 00000296 ORIG_RAX: 00000000000000bb RAX: ffffffffffffffda RBX: 0000000000000007 RCX: 0000000000000008 RDX: 0000000000000000 RSI: 000000000000ef84 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 retq 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi