====================================================== WARNING: possible circular locking dependency detected 5.15.179-syzkaller #0 Not tainted ------------------------------------------------------ syz.8.664/7363 is trying to acquire lock: ffff88804cc3ea20 (&oi->ip_alloc_sem){++++}-{3:3}, at: ocfs2_read_virt_blocks+0x2b3/0xa10 fs/ocfs2/extent_map.c:976 but task is already holding lock: ffff88807d8d4990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x12b9/0x1570 fs/jbd2/transaction.c:462 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (jbd2_handle){++++}-{0:0}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 start_this_handle+0x12e1/0x1570 fs/jbd2/transaction.c:464 jbd2__journal_start+0x2d1/0x5c0 fs/jbd2/transaction.c:521 jbd2_journal_start+0x25/0x30 fs/jbd2/transaction.c:560 ocfs2_start_trans+0x3c2/0x6f0 fs/ocfs2/journal.c:354 ocfs2_symlink+0x147f/0x2e20 fs/ocfs2/namei.c:1915 vfs_symlink+0x247/0x3d0 fs/namei.c:4429 do_symlinkat+0x1fd/0x600 fs/namei.c:4458 __do_sys_symlinkat fs/namei.c:4475 [inline] __se_sys_symlinkat fs/namei.c:4472 [inline] __x64_sys_symlinkat+0x95/0xa0 fs/namei.c:4472 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #2 (&journal->j_trans_barrier){.+.+}-{3:3}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 down_read+0x45/0x2e0 kernel/locking/rwsem.c:1498 ocfs2_start_trans+0x3b7/0x6f0 fs/ocfs2/journal.c:352 ocfs2_symlink+0x147f/0x2e20 fs/ocfs2/namei.c:1915 vfs_symlink+0x247/0x3d0 fs/namei.c:4429 do_symlinkat+0x1fd/0x600 fs/namei.c:4458 __do_sys_symlinkat fs/namei.c:4475 [inline] __se_sys_symlinkat fs/namei.c:4472 [inline] __x64_sys_symlinkat+0x95/0xa0 fs/namei.c:4472 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #1 (sb_internal#5){.+.+}-{0:0}: lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1811 [inline] sb_start_intwrite include/linux/fs.h:1928 [inline] ocfs2_start_trans+0x2b2/0x6f0 fs/ocfs2/journal.c:350 ocfs2_setattr+0xebe/0x1ce0 fs/ocfs2/file.c:1254 notify_change+0xc6d/0xf50 fs/attr.c:505 chown_common+0x592/0x890 fs/open.c:680 do_fchownat+0x169/0x240 fs/open.c:711 __do_sys_lchown fs/open.c:736 [inline] __se_sys_lchown fs/open.c:734 [inline] __x64_sys_lchown+0x81/0x90 fs/open.c:734 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (&oi->ip_alloc_sem){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 down_read+0x45/0x2e0 kernel/locking/rwsem.c:1498 ocfs2_read_virt_blocks+0x2b3/0xa10 fs/ocfs2/extent_map.c:976 ocfs2_read_dir_block+0x102/0x5b0 fs/ocfs2/dir.c:508 ocfs2_dir_foreach_blk_el fs/ocfs2/dir.c:1842 [inline] ocfs2_dir_foreach_blk+0x2a8/0x1ba0 fs/ocfs2/dir.c:1928 ocfs2_dir_foreach fs/ocfs2/dir.c:1938 [inline] ocfs2_empty_dir+0x1d1/0x8c0 fs/ocfs2/dir.c:2156 ocfs2_rename+0x25d5/0x3ea0 fs/ocfs2/namei.c:1499 vfs_rename+0xd32/0x10f0 fs/namei.c:4832 do_renameat2+0xe0f/0x1700 fs/namei.c:4985 __do_sys_renameat2 fs/namei.c:5018 [inline] __se_sys_renameat2 fs/namei.c:5015 [inline] __x64_sys_renameat2+0xce/0xe0 fs/namei.c:5015 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Chain exists of: &oi->ip_alloc_sem --> &journal->j_trans_barrier --> jbd2_handle Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(jbd2_handle); lock(&journal->j_trans_barrier); lock(jbd2_handle); lock(&oi->ip_alloc_sem); *** DEADLOCK *** 10 locks held by syz.8.664/7363: #0: ffff888065e0e460 (sb_writers#25){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:377 #1: ffff888065e0e748 (&type->s_vfs_rename_key#4){+.+.}-{3:3}, at: lock_rename fs/namei.c:3016 [inline] #1: ffff888065e0e748 (&type->s_vfs_rename_key#4){+.+.}-{3:3}, at: do_renameat2+0x5b7/0x1700 fs/namei.c:4924 #2: ffff88805b6a1808 (&type->i_mutex_dir_key#17/1){+.+.}-{3:3}, at: lock_two_directories fs/namei.c:-1 [inline] #2: ffff88805b6a1808 (&type->i_mutex_dir_key#17/1){+.+.}-{3:3}, at: lock_rename fs/namei.c:3017 [inline] #2: ffff88805b6a1808 (&type->i_mutex_dir_key#17/1){+.+.}-{3:3}, at: do_renameat2+0x644/0x1700 fs/namei.c:4924 #3: ffff88804cc3df48 (&sb->s_type->i_mutex_key#36/5){+.+.}-{3:3}, at: lock_rename fs/namei.c:-1 [inline] #3: ffff88804cc3df48 (&sb->s_type->i_mutex_key#36/5){+.+.}-{3:3}, at: do_renameat2+0x67e/0x1700 fs/namei.c:4924 #4: ffff88804cc3d108 (&sb->s_type->i_mutex_key#36/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:822 [inline] #4: ffff88804cc3d108 (&sb->s_type->i_mutex_key#36/2){+.+.}-{3:3}, at: vfs_rename+0x7a2/0x10f0 fs/namei.c:4795 #5: ffff88804cc3ed88 (&sb->s_type->i_mutex_key#36){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #5: ffff88804cc3ed88 (&sb->s_type->i_mutex_key#36){+.+.}-{3:3}, at: vfs_rename+0x814/0x10f0 fs/namei.c:4797 #6: ffff88805b6a6d88 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #6: ffff88805b6a6d88 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]){+.+.}-{3:3}, at: ocfs2_lookup_lock_orphan_dir+0xfe/0x340 fs/ocfs2/namei.c:2116 #7: ffff888065e0e650 (sb_internal#5){.+.+}-{0:0}, at: ocfs2_rename+0x1e36/0x3ea0 fs/ocfs2/namei.c:1488 #8: ffff88802404e8e8 (&journal->j_trans_barrier){.+.+}-{3:3}, at: ocfs2_start_trans+0x3b7/0x6f0 fs/ocfs2/journal.c:352 #9: ffff88807d8d4990 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0x12b9/0x1570 fs/jbd2/transaction.c:462 stack backtrace: CPU: 1 PID: 7363 Comm: syz.8.664 Not tainted 5.15.179-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 check_noncircular+0x2f8/0x3b0 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+0x1649/0x5930 kernel/locking/lockdep.c:3788 __lock_acquire+0x1295/0x1ff0 kernel/locking/lockdep.c:5012 lock_acquire+0x1db/0x4f0 kernel/locking/lockdep.c:5623 down_read+0x45/0x2e0 kernel/locking/rwsem.c:1498 ocfs2_read_virt_blocks+0x2b3/0xa10 fs/ocfs2/extent_map.c:976 ocfs2_read_dir_block+0x102/0x5b0 fs/ocfs2/dir.c:508 ocfs2_dir_foreach_blk_el fs/ocfs2/dir.c:1842 [inline] ocfs2_dir_foreach_blk+0x2a8/0x1ba0 fs/ocfs2/dir.c:1928 ocfs2_dir_foreach fs/ocfs2/dir.c:1938 [inline] ocfs2_empty_dir+0x1d1/0x8c0 fs/ocfs2/dir.c:2156 ocfs2_rename+0x25d5/0x3ea0 fs/ocfs2/namei.c:1499 vfs_rename+0xd32/0x10f0 fs/namei.c:4832 do_renameat2+0xe0f/0x1700 fs/namei.c:4985 __do_sys_renameat2 fs/namei.c:5018 [inline] __se_sys_renameat2 fs/namei.c:5015 [inline] __x64_sys_renameat2+0xce/0xe0 fs/namei.c:5015 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7faf099d0169 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:00007faf07839038 EFLAGS: 00000246 ORIG_RAX: 000000000000013c RAX: ffffffffffffffda RBX: 00007faf09be8fa0 RCX: 00007faf099d0169 RDX: 0000000000000004 RSI: 0000200000000140 RDI: 0000000000000004 RBP: 00007faf09a512a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000200000000200 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007faf09be8fa0 R15: 00007ffe2c8f9328