====================================================== WARNING: possible circular locking dependency detected 6.12.0-rc7-syzkaller #0 Not tainted ------------------------------------------------------ syz.0.15/6526 is trying to acquire lock: ffff8880723b0660 (&oi->ip_alloc_sem){+.+.}-{3:3}, at: ocfs2_try_remove_refcount_tree+0xb6/0x330 fs/ocfs2/refcounttree.c:932 but task is already holding lock: ffff8880723b06f8 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_try_remove_refcount_tree+0xa5/0x330 fs/ocfs2/refcounttree.c:931 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&oi->ip_xattr_sem){++++}-{3:3}: down_read+0xb1/0xa40 kernel/locking/rwsem.c:1524 ocfs2_init_acl+0x397/0x930 fs/ocfs2/acl.c:366 ocfs2_mknod+0x1ca3/0x2c00 fs/ocfs2/namei.c:408 ocfs2_create+0x1ab/0x480 fs/ocfs2/namei.c:672 lookup_open fs/namei.c:3595 [inline] open_last_lookups fs/namei.c:3694 [inline] path_openat+0x1c03/0x3590 fs/namei.c:3930 do_filp_open+0x235/0x490 fs/namei.c:3960 file_open_name fs/open.c:1360 [inline] filp_open+0x261/0x2d0 fs/open.c:1380 do_coredump+0x1fbe/0x2ec0 fs/coredump.c:699 get_signal+0x13f0/0x1730 kernel/signal.c:2903 arch_do_signal_or_restart+0x96/0x830 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] irqentry_exit_to_user_mode+0x78/0x270 kernel/entry/common.c:231 exc_page_fault+0x522/0x810 arch/x86/mm/fault.c:1542 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #3 (jbd2_handle){++++}-{0:0}: start_this_handle+0x1eb7/0x2110 fs/jbd2/transaction.c:448 jbd2__journal_start+0x306/0x620 fs/jbd2/transaction.c:505 jbd2_journal_start+0x29/0x40 fs/jbd2/transaction.c:544 ocfs2_start_trans+0x3c9/0x700 fs/ocfs2/journal.c:352 ocfs2_mknod+0x1552/0x2c00 fs/ocfs2/namei.c:359 ocfs2_create+0x1ab/0x480 fs/ocfs2/namei.c:672 lookup_open fs/namei.c:3595 [inline] open_last_lookups fs/namei.c:3694 [inline] path_openat+0x1c03/0x3590 fs/namei.c:3930 do_filp_open+0x235/0x490 fs/namei.c:3960 file_open_name fs/open.c:1360 [inline] filp_open+0x261/0x2d0 fs/open.c:1380 do_coredump+0x1fbe/0x2ec0 fs/coredump.c:699 get_signal+0x13f0/0x1730 kernel/signal.c:2903 arch_do_signal_or_restart+0x96/0x830 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] irqentry_exit_to_user_mode+0x78/0x270 kernel/entry/common.c:231 exc_page_fault+0x522/0x810 arch/x86/mm/fault.c:1542 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #2 (&journal->j_trans_barrier){.+.+}-{3:3}: down_read+0xb1/0xa40 kernel/locking/rwsem.c:1524 ocfs2_start_trans+0x3be/0x700 fs/ocfs2/journal.c:350 ocfs2_mknod+0x1552/0x2c00 fs/ocfs2/namei.c:359 ocfs2_create+0x1ab/0x480 fs/ocfs2/namei.c:672 lookup_open fs/namei.c:3595 [inline] open_last_lookups fs/namei.c:3694 [inline] path_openat+0x1c03/0x3590 fs/namei.c:3930 do_filp_open+0x235/0x490 fs/namei.c:3960 file_open_name fs/open.c:1360 [inline] filp_open+0x261/0x2d0 fs/open.c:1380 do_coredump+0x1fbe/0x2ec0 fs/coredump.c:699 get_signal+0x13f0/0x1730 kernel/signal.c:2903 arch_do_signal_or_restart+0x96/0x830 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] irqentry_exit_to_user_mode+0x78/0x270 kernel/entry/common.c:231 exc_page_fault+0x522/0x810 arch/x86/mm/fault.c:1542 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #1 (sb_internal#2){.+.+}-{0:0}: percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1716 [inline] sb_start_intwrite include/linux/fs.h:1899 [inline] ocfs2_start_trans+0x2b9/0x700 fs/ocfs2/journal.c:348 ocfs2_orphan_for_truncate fs/ocfs2/file.c:396 [inline] ocfs2_truncate_file+0x68c/0x1550 fs/ocfs2/file.c:500 ocfs2_setattr+0x1890/0x1ef0 fs/ocfs2/file.c:1212 notify_change+0xbca/0xe90 fs/attr.c:503 do_truncate+0x220/0x310 fs/open.c:65 do_coredump+0x2851/0x2ec0 fs/coredump.c:735 get_signal+0x13f0/0x1730 kernel/signal.c:2903 arch_do_signal_or_restart+0x96/0x830 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] irqentry_exit_to_user_mode+0x78/0x270 kernel/entry/common.c:231 exc_page_fault+0x522/0x810 arch/x86/mm/fault.c:1542 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #0 (&oi->ip_alloc_sem){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x2f62/0x8080 kernel/locking/lockdep.c:5202 lock_acquire+0x1ed/0x540 kernel/locking/lockdep.c:5825 down_write+0x99/0x220 kernel/locking/rwsem.c:1577 ocfs2_try_remove_refcount_tree+0xb6/0x330 fs/ocfs2/refcounttree.c:932 ocfs2_truncate_file+0xe04/0x1550 fs/ocfs2/file.c:521 ocfs2_setattr+0x1890/0x1ef0 fs/ocfs2/file.c:1212 notify_change+0xbca/0xe90 fs/attr.c:503 do_truncate+0x220/0x310 fs/open.c:65 do_coredump+0x2851/0x2ec0 fs/coredump.c:735 get_signal+0x13f0/0x1730 kernel/signal.c:2903 arch_do_signal_or_restart+0x96/0x830 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] irqentry_exit_to_user_mode+0x78/0x270 kernel/entry/common.c:231 exc_page_fault+0x522/0x810 arch/x86/mm/fault.c:1542 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 other info that might help us debug this: Chain exists of: &oi->ip_alloc_sem --> jbd2_handle --> &oi->ip_xattr_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&oi->ip_xattr_sem); lock(jbd2_handle); lock(&oi->ip_xattr_sem); lock(&oi->ip_alloc_sem); *** DEADLOCK *** 2 locks held by syz.0.15/6526: #0: ffff8880723b09c0 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:815 [inline] #0: ffff8880723b09c0 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: do_truncate+0x20c/0x310 fs/open.c:63 #1: ffff8880723b06f8 (&oi->ip_xattr_sem){++++}-{3:3}, at: ocfs2_try_remove_refcount_tree+0xa5/0x330 fs/ocfs2/refcounttree.c:931 stack backtrace: CPU: 1 UID: 0 PID: 6526 Comm: syz.0.15 Not tainted 6.12.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/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+0x379/0x4b0 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 kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x2f62/0x8080 kernel/locking/lockdep.c:5202 lock_acquire+0x1ed/0x540 kernel/locking/lockdep.c:5825 down_write+0x99/0x220 kernel/locking/rwsem.c:1577 ocfs2_try_remove_refcount_tree+0xb6/0x330 fs/ocfs2/refcounttree.c:932 ocfs2_truncate_file+0xe04/0x1550 fs/ocfs2/file.c:521 ocfs2_setattr+0x1890/0x1ef0 fs/ocfs2/file.c:1212 notify_change+0xbca/0xe90 fs/attr.c:503 do_truncate+0x220/0x310 fs/open.c:65 do_coredump+0x2851/0x2ec0 fs/coredump.c:735 get_signal+0x13f0/0x1730 kernel/signal.c:2903 arch_do_signal_or_restart+0x96/0x830 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] irqentry_exit_to_user_mode+0x78/0x270 kernel/entry/common.c:231 exc_page_fault+0x522/0x810 arch/x86/mm/fault.c:1542 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0033:0x0 Code: Unable to access opcode bytes at 0xffffffffffffffd6. RSP: 002b:00000000200000c8 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007fc124735f80 RCX: 00007fc12457e719 RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000004000000 RBP: 00007fc1245f139e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fc124735f80 R15: 00007ffc9f727fa8 ocfs2: Unmounting device (7,0) on (node local) syz.0.15 (6526) used greatest stack depth: 17488 bytes left