====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.2.70/6367 is trying to acquire lock: ffff888068120858 (&oi->ip_xattr_sem){++++}-{4:4}, at: ocfs2_xattr_get+0xf4/0x260 fs/ocfs2/xattr.c:1716 but task is already holding lock: ffff888063fb3518 (&journal->j_trans_barrier){.+.+}-{4:4}, at: ocfs2_start_trans+0x3aa/0x700 fs/ocfs2/journal.c:379 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&journal->j_trans_barrier){.+.+}-{4:4}: down_read+0x92/0x200 kernel/locking/rwsem.c:1574 ocfs2_start_trans+0x3aa/0x700 fs/ocfs2/journal.c:379 ocfs2_shutdown_local_alloc+0x1ef/0xa50 fs/ocfs2/localalloc.c:417 ocfs2_dismount_volume+0x1ea/0x860 fs/ocfs2/super.c:1837 generic_shutdown_super+0x140/0x2d0 fs/super.c:723 kill_block_super+0x44/0xa0 fs/super.c:1852 deactivate_locked_super+0xbe/0x110 fs/super.c:558 cleanup_mnt+0x204/0x2a0 fs/namespace.c:1396 task_work_run+0x1d9/0x260 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:70 [inline] exit_to_user_mode_loop+0x204/0x770 kernel/entry/common.c:101 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:343 [inline] do_syscall_64+0x336/0x540 arch/x86/entry/syscall_64.c:107 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (sb_internal#2){.+.+}-{0:0}: percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline] percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline] __sb_start_write include/linux/fs/super.h:19 [inline] sb_start_intwrite include/linux/fs/super.h:177 [inline] ocfs2_start_trans+0x2a7/0x700 fs/ocfs2/journal.c:377 ocfs2_orphan_for_truncate fs/ocfs2/file.c:418 [inline] ocfs2_truncate_file+0x634/0x14b0 fs/ocfs2/file.c:527 ocfs2_setattr+0x1438/0x1d60 fs/ocfs2/file.c:1249 notify_change+0xbb8/0xec0 fs/attr.c:556 do_truncate+0x1c2/0x250 fs/open.c:68 handle_truncate fs/namei.c:4306 [inline] do_open fs/namei.c:4855 [inline] path_openat+0x18ab/0x2100 fs/namei.c:5016 do_file_open+0x23e/0x4a0 fs/namei.c:5045 do_sys_openat2+0x115/0x200 fs/open.c:1443 do_sys_open fs/open.c:1449 [inline] __do_sys_creat fs/open.c:1527 [inline] __se_sys_creat fs/open.c:1521 [inline] __x64_sys_creat+0x8f/0xc0 fs/open.c:1521 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&oi->ip_alloc_sem#2){+.+.}-{4:4}: down_write+0x35/0x50 kernel/locking/rwsem.c:1631 ocfs2_try_remove_refcount_tree+0xb6/0x360 fs/ocfs2/refcounttree.c:988 ocfs2_truncate_file+0xe91/0x14b0 fs/ocfs2/file.c:548 ocfs2_setattr+0x1438/0x1d60 fs/ocfs2/file.c:1249 notify_change+0xbb8/0xec0 fs/attr.c:556 do_truncate+0x1c2/0x250 fs/open.c:68 handle_truncate fs/namei.c:4306 [inline] do_open fs/namei.c:4855 [inline] path_openat+0x18ab/0x2100 fs/namei.c:5016 do_file_open+0x23e/0x4a0 fs/namei.c:5045 do_sys_openat2+0x115/0x200 fs/open.c:1443 do_sys_open fs/open.c:1449 [inline] __do_sys_creat fs/open.c:1527 [inline] __se_sys_creat fs/open.c:1521 [inline] __x64_sys_creat+0x8f/0xc0 fs/open.c:1521 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&oi->ip_xattr_sem){++++}-{4:4}: check_prev_add kernel/locking/lockdep.c:3209 [inline] check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x164c/0x2de0 kernel/locking/lockdep.c:5288 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942 down_read+0x92/0x200 kernel/locking/rwsem.c:1574 ocfs2_xattr_get+0xf4/0x260 fs/ocfs2/xattr.c:1716 __vfs_getxattr+0x412/0x440 fs/xattr.c:446 smk_fetch+0xb4/0x140 security/smack/smack_lsm.c:298 smack_d_instantiate+0x5bb/0x810 security/smack/smack_lsm.c:3686 security_d_instantiate+0x106/0x1d0 security/security.c:3783 d_instantiate+0x54/0xb0 fs/dcache.c:2295 ocfs2_mknod+0x199e/0x2190 fs/ocfs2/namei.c:453 ocfs2_mkdir+0x180/0x430 fs/ocfs2/namei.c:661 vfs_mkdir+0x417/0x670 fs/namei.c:5428 filename_mkdirat+0x288/0x560 fs/namei.c:5461 __do_sys_mkdirat fs/namei.c:5482 [inline] __se_sys_mkdirat+0x35/0x150 fs/namei.c:5479 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &oi->ip_xattr_sem --> sb_internal#2 --> &journal->j_trans_barrier Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(&journal->j_trans_barrier); lock(sb_internal#2); lock(&journal->j_trans_barrier); rlock(&oi->ip_xattr_sem); *** DEADLOCK *** locks held by syz.2.70/6367: 8, on CPU#1: #0: ffff888065bb8528 (sb_writers#22){.+.+}-{0:0}, at: mnt_want_write+0x41/0x90 fs/namespace.c:531 #1: ffff8880637dad00 (&type->i_mutex_dir_key#9/1){+.+.}-{4:4}, at: inode_lock_nested include/linux/fs.h:1072 [inline] #1: ffff8880637dad00 (&type->i_mutex_dir_key#9/1){+.+.}-{4:4}, at: __start_dirop fs/namei.c:2924 [inline] #1: ffff8880637dad00 (&type->i_mutex_dir_key#9/1){+.+.}-{4:4}, at: start_dirop fs/namei.c:2948 [inline] #1: ffff8880637dad00 (&type->i_mutex_dir_key#9/1){+.+.}-{4:4}, at: filename_create+0x200/0x370 fs/namei.c:5108 #2: ffff888064e32d00 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1027 [inline] #2: ffff888064e32d00 (&ocfs2_sysfile_lock_key[INODE_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_reserve_suballoc_bits+0x170/0x4850 fs/ocfs2/suballoc.c:904 #3: ffff888064e33dc0 (&ocfs2_sysfile_lock_key[EXTENT_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1027 [inline] #3: ffff888064e33dc0 (&ocfs2_sysfile_lock_key[EXTENT_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_reserve_suballoc_bits+0x170/0x4850 fs/ocfs2/suballoc.c:904 #4: ffff888064e30b80 (&ocfs2_sysfile_lock_key[LOCAL_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:1027 [inline] #4: ffff888064e30b80 (&ocfs2_sysfile_lock_key[LOCAL_ALLOC_SYSTEM_INODE]){+.+.}-{4:4}, at: ocfs2_reserve_local_alloc_bits+0x11f/0x2680 fs/ocfs2/localalloc.c:636 #5: ffff888065bb8818 (sb_internal#2){.+.+}-{0:0}, at: ocfs2_mknod+0xf07/0x2190 fs/ocfs2/namei.c:364 #6: ffff888063fb3518 (&journal->j_trans_barrier){.+.+}-{4:4}, at: ocfs2_start_trans+0x3aa/0x700 fs/ocfs2/journal.c:379 #7: ffff88802af24bd0 (jbd2_handle#2){.+.+}-{0:0}, at: start_this_handle+0x1fb0/0x21f0 fs/jbd2/transaction.c:444 stack backtrace: CPU: 1 UID: 0 PID: 6367 Comm: syz.2.70 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_circular_bug+0x2e2/0x300 kernel/locking/lockdep.c:2087 check_noncircular+0x12f/0x150 kernel/locking/lockdep.c:2219 check_prev_add kernel/locking/lockdep.c:3209 [inline] check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x164c/0x2de0 kernel/locking/lockdep.c:5288 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942 down_read+0x92/0x200 kernel/locking/rwsem.c:1574 ocfs2_xattr_get+0xf4/0x260 fs/ocfs2/xattr.c:1716 __vfs_getxattr+0x412/0x440 fs/xattr.c:446 smk_fetch+0xb4/0x140 security/smack/smack_lsm.c:298 smack_d_instantiate+0x5bb/0x810 security/smack/smack_lsm.c:3686 security_d_instantiate+0x106/0x1d0 security/security.c:3783 d_instantiate+0x54/0xb0 fs/dcache.c:2295 ocfs2_mknod+0x199e/0x2190 fs/ocfs2/namei.c:453 ocfs2_mkdir+0x180/0x430 fs/ocfs2/namei.c:661 vfs_mkdir+0x417/0x670 fs/namei.c:5428 filename_mkdirat+0x288/0x560 fs/namei.c:5461 __do_sys_mkdirat fs/namei.c:5482 [inline] __se_sys_mkdirat+0x35/0x150 fs/namei.c:5479 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f4be1cb83c7 Code: 00 66 90 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 db f7 ff ff 66 2e 0f 1f 84 00 00 00 00 00 90 b8 02 01 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f4bdff05e58 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f4bdff05ee0 RCX: 00007f4be1cb83c7 RDX: 00000000000001ff RSI: 000020000000a8c0 RDI: 00000000ffffff9c RBP: 000020000000a880 R08: 0000000000000001 R09: 000020000000a9c0 R10: 000020000000a880 R11: 0000000000000246 R12: 000020000000a8c0 R13: 00007f4bdff05ea0 R14: 0000000000000000 R15: 0000000000000000