====================================================== WARNING: possible circular locking dependency detected 5.15.189-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/5374 is trying to acquire lock: ffff88814d4d63f8 (&journal->j_checkpoint_mutex){+.+.}-{3:3}, at: __jbd2_log_wait_for_space+0x216/0x660 fs/jbd2/checkpoint.c:71 but task is already holding lock: ffff88807275bfc0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] ffff88807275bfc0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_buffered_write_iter+0xa6/0x3b0 fs/ext4/file.c:262 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&sb->s_type->i_mutex_key#9){++++}-{3:3}: down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498 inode_lock_shared include/linux/fs.h:797 [inline] ext4_bmap+0x4d/0x3f0 fs/ext4/inode.c:3164 bmap+0xa2/0xd0 fs/inode.c:1820 jbd2_journal_bmap fs/jbd2/journal.c:981 [inline] __jbd2_journal_erase fs/jbd2/journal.c:1795 [inline] jbd2_journal_flush+0x648/0xca0 fs/jbd2/journal.c:2501 ext4_ioctl_checkpoint fs/ext4/ioctl.c:849 [inline] __ext4_ioctl fs/ext4/ioctl.c:1273 [inline] ext4_ioctl+0x2e93/0x3590 fs/ext4/ioctl.c:1282 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (&journal->j_checkpoint_mutex){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1eb/0x2390 kernel/locking/mutex.c:596 mutex_lock_io_nested+0x43/0x60 kernel/locking/mutex.c:777 __jbd2_log_wait_for_space+0x216/0x660 fs/jbd2/checkpoint.c:71 add_transaction_credits+0x922/0xc30 fs/jbd2/transaction.c:299 start_this_handle+0x70e/0x15a0 fs/jbd2/transaction.c:423 jbd2__journal_start+0x2b7/0x5a0 fs/jbd2/transaction.c:521 __ext4_journal_start_sb+0x167/0x360 fs/ext4/ext4_jbd2.c:105 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_dirty_inode+0x8b/0x100 fs/ext4/inode.c:6037 __mark_inode_dirty+0x2b0/0xc60 fs/fs-writeback.c:2464 mark_inode_dirty include/linux/fs.h:2467 [inline] generic_write_end+0x24d/0x3d0 fs/buffer.c:2204 ext4_da_write_end+0x6f6/0x9c0 fs/ext4/inode.c:3096 generic_perform_write+0x344/0x530 mm/filemap.c:3796 ext4_buffered_write_iter+0x25f/0x3b0 fs/ext4/file.c:268 ext4_file_write_iter+0x773/0x17b0 fs/ext4/file.c:-1 __kernel_write+0x4f9/0x930 fs/read_write.c:539 __dump_emit+0x243/0x360 fs/coredump.c:943 dump_user_range+0x84/0x340 fs/coredump.c:1017 elf_core_dump+0x2ff7/0x3530 fs/binfmt_elf.c:2285 do_coredump+0x1419/0x2960 fs/coredump.c:894 get_signal+0x40a/0x12c0 kernel/signal.c:2886 arch_do_signal_or_restart+0xc1/0x1300 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:154 [inline] exit_to_user_mode_loop+0x9e/0x130 kernel/entry/common.c:178 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sb->s_type->i_mutex_key#9); lock(&journal->j_checkpoint_mutex); lock(&sb->s_type->i_mutex_key#9); lock(&journal->j_checkpoint_mutex); *** DEADLOCK *** 2 locks held by syz-executor.5/5374: #0: ffff88814d4d2460 (sb_writers#5){.+.+}-{0:0}, at: do_coredump+0x13fd/0x2960 fs/coredump.c:893 #1: ffff88807275bfc0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #1: ffff88807275bfc0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_buffered_write_iter+0xa6/0x3b0 fs/ext4/file.c:262 stack backtrace: CPU: 0 PID: 5374 Comm: syz-executor.5 Not tainted 5.15.189-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c33/0x7c60 kernel/locking/lockdep.c:5012 lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623 __mutex_lock_common+0x1eb/0x2390 kernel/locking/mutex.c:596 mutex_lock_io_nested+0x43/0x60 kernel/locking/mutex.c:777 __jbd2_log_wait_for_space+0x216/0x660 fs/jbd2/checkpoint.c:71 add_transaction_credits+0x922/0xc30 fs/jbd2/transaction.c:299 start_this_handle+0x70e/0x15a0 fs/jbd2/transaction.c:423 jbd2__journal_start+0x2b7/0x5a0 fs/jbd2/transaction.c:521 __ext4_journal_start_sb+0x167/0x360 fs/ext4/ext4_jbd2.c:105 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_dirty_inode+0x8b/0x100 fs/ext4/inode.c:6037 __mark_inode_dirty+0x2b0/0xc60 fs/fs-writeback.c:2464 mark_inode_dirty include/linux/fs.h:2467 [inline] generic_write_end+0x24d/0x3d0 fs/buffer.c:2204 ext4_da_write_end+0x6f6/0x9c0 fs/ext4/inode.c:3096 generic_perform_write+0x344/0x530 mm/filemap.c:3796 ext4_buffered_write_iter+0x25f/0x3b0 fs/ext4/file.c:268 ext4_file_write_iter+0x773/0x17b0 fs/ext4/file.c:-1 __kernel_write+0x4f9/0x930 fs/read_write.c:539 __dump_emit+0x243/0x360 fs/coredump.c:943 dump_user_range+0x84/0x340 fs/coredump.c:1017 elf_core_dump+0x2ff7/0x3530 fs/binfmt_elf.c:2285 do_coredump+0x1419/0x2960 fs/coredump.c:894 get_signal+0x40a/0x12c0 kernel/signal.c:2886 arch_do_signal_or_restart+0xc1/0x1300 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:154 [inline] exit_to_user_mode_loop+0x9e/0x130 kernel/entry/common.c:178 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f1e911fcfb5 Code: 24 0c 89 3c 24 48 89 4c 24 18 e8 f6 b9 ff ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 8b 74 24 0c 8b 3c 24 b8 e6 00 00 00 0f 05 <44> 89 c7 48 89 04 24 e8 4f ba ff ff 48 8b 04 24 48 83 c4 28 f7 d8 RSP: 002b:00007f1e90553010 EFLAGS: 00000393 ORIG_RAX: 00000000000000db RAX: 0000000000000000 RBX: 00007f1e912f0f80 RCX: 00007f1e911fcfb5 RDX: 00007f1e90553050 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007f1e9121d47a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000393 R12: 0000000000000000 R13: 000000000000000b R14: 00007f1e912f0f80 R15: 00007fff7c094bf8