F2FS-fs (loop0): invalid crc value F2FS-fs (loop0): Found nat_bits in checkpoint F2FS-fs (loop0): Mounted with checkpoint version = 48b305e4 ====================================================== WARNING: possible circular locking dependency detected 6.1.53-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/7198 is trying to acquire lock: ffff0000e26bbd30 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2154 [inline] ffff0000e26bbd30 (&fi->i_xattr_sem){.+.+}-{3:3}, at: f2fs_getxattr+0xa4/0x1198 fs/f2fs/xattr.c:531 but task is already holding lock: ffff0000e26bde38 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2179 [inline] ffff0000e26bde38 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x30/0x198 fs/f2fs/dir.c:869 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&fi->i_sem){+.+.}-{3:3}: down_write+0x5c/0x88 kernel/locking/rwsem.c:1573 f2fs_down_write fs/f2fs/f2fs.h:2179 [inline] f2fs_add_inline_entry+0x350/0x650 fs/f2fs/inline.c:645 f2fs_add_dentry fs/f2fs/dir.c:815 [inline] f2fs_do_add_link+0x2c4/0x5a4 fs/f2fs/dir.c:858 f2fs_add_link fs/f2fs/f2fs.h:3530 [inline] f2fs_mkdir+0x2a4/0x4ec fs/f2fs/namei.c:771 vfs_mkdir+0x334/0x4e4 fs/namei.c:4036 do_mkdirat+0x20c/0x610 fs/namei.c:4061 __do_sys_mkdirat fs/namei.c:4076 [inline] __se_sys_mkdirat fs/namei.c:4074 [inline] __arm64_sys_mkdirat+0x90/0xa8 fs/namei.c:4074 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 -> #0 (&fi->i_xattr_sem){.+.+}-{3:3}: check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3824 [inline] __lock_acquire+0x3338/0x764c kernel/locking/lockdep.c:5048 lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5661 down_read+0x64/0x308 kernel/locking/rwsem.c:1520 f2fs_down_read fs/f2fs/f2fs.h:2154 [inline] f2fs_getxattr+0xa4/0x1198 fs/f2fs/xattr.c:531 __f2fs_get_acl+0x6c/0x5e4 fs/f2fs/acl.c:179 f2fs_acl_create fs/f2fs/acl.c:375 [inline] f2fs_init_acl+0xe8/0x8e8 fs/f2fs/acl.c:418 f2fs_init_inode_metadata+0x8a8/0x11e8 fs/f2fs/dir.c:587 f2fs_do_tmpfile+0x44/0x198 fs/f2fs/dir.c:870 __f2fs_tmpfile+0x1d4/0x33c fs/f2fs/namei.c:874 f2fs_create_whiteout fs/f2fs/namei.c:936 [inline] f2fs_rename fs/f2fs/namei.c:986 [inline] f2fs_rename2+0x84c/0x20e8 fs/f2fs/namei.c:1325 vfs_rename+0x8b8/0xd04 fs/namei.c:4785 do_renameat2+0x980/0x1040 fs/namei.c:4935 __do_sys_renameat2 fs/namei.c:4968 [inline] __se_sys_renameat2 fs/namei.c:4965 [inline] __arm64_sys_renameat2+0xe0/0xfc fs/namei.c:4965 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&fi->i_sem); lock(&fi->i_xattr_sem); lock(&fi->i_sem); lock(&fi->i_xattr_sem); *** DEADLOCK *** 8 locks held by syz-executor.0/7198: #0: ffff0000d4454460 (sb_writers#16){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:393 #1: ffff0000d4454748 (&type->s_vfs_rename_key#2){+.+.}-{3:3}, at: lock_rename+0x54/0x198 fs/namei.c:2994 #2: ffff0000e26bb6c0 (&type->i_mutex_dir_key#11/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline] #2: ffff0000e26bb6c0 (&type->i_mutex_dir_key#11/1){+.+.}-{3:3}, at: lock_rename+0x94/0x198 fs/namei.c:2998 #3: ffff0000e26bbfa8 (&type->i_mutex_dir_key#12/2){+.+.}-{3:3}, at: lock_rename+0x14c/0x198 #4: ffff0000e26bc890 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline] #4: ffff0000e26bc890 (&sb->s_type->i_mutex_key#24){+.+.}-{3:3}, at: lock_two_inodes+0xdc/0x158 fs/inode.c:1143 #5: ffff0000e26bd178 (&sb->s_type->i_mutex_key#24/4){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline] #5: ffff0000e26bd178 (&sb->s_type->i_mutex_key#24/4){+.+.}-{3:3}, at: lock_two_inodes+0xf8/0x158 fs/inode.c:1145 #6: ffff0000dca743b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2154 [inline] #6: ffff0000dca743b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_lock_op fs/f2fs/f2fs.h:2197 [inline] #6: ffff0000dca743b0 (&sbi->cp_rwsem){++++}-{3:3}, at: __f2fs_tmpfile+0x1a4/0x33c fs/f2fs/namei.c:869 #7: ffff0000e26bde38 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2179 [inline] #7: ffff0000e26bde38 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x30/0x198 fs/f2fs/dir.c:869 stack backtrace: CPU: 0 PID: 7198 Comm: syz-executor.0 Not tainted 6.1.53-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 print_circular_bug+0x150/0x1b8 kernel/locking/lockdep.c:2048 check_noncircular+0x2cc/0x378 kernel/locking/lockdep.c:2170 check_prev_add kernel/locking/lockdep.c:3090 [inline] check_prevs_add kernel/locking/lockdep.c:3209 [inline] validate_chain kernel/locking/lockdep.c:3824 [inline] __lock_acquire+0x3338/0x764c kernel/locking/lockdep.c:5048 lock_acquire+0x26c/0x7cc kernel/locking/lockdep.c:5661 down_read+0x64/0x308 kernel/locking/rwsem.c:1520 f2fs_down_read fs/f2fs/f2fs.h:2154 [inline] f2fs_getxattr+0xa4/0x1198 fs/f2fs/xattr.c:531 __f2fs_get_acl+0x6c/0x5e4 fs/f2fs/acl.c:179 f2fs_acl_create fs/f2fs/acl.c:375 [inline] f2fs_init_acl+0xe8/0x8e8 fs/f2fs/acl.c:418 f2fs_init_inode_metadata+0x8a8/0x11e8 fs/f2fs/dir.c:587 f2fs_do_tmpfile+0x44/0x198 fs/f2fs/dir.c:870 __f2fs_tmpfile+0x1d4/0x33c fs/f2fs/namei.c:874 f2fs_create_whiteout fs/f2fs/namei.c:936 [inline] f2fs_rename fs/f2fs/namei.c:986 [inline] f2fs_rename2+0x84c/0x20e8 fs/f2fs/namei.c:1325 vfs_rename+0x8b8/0xd04 fs/namei.c:4785 do_renameat2+0x980/0x1040 fs/namei.c:4935 __do_sys_renameat2 fs/namei.c:4968 [inline] __se_sys_renameat2 fs/namei.c:4965 [inline] __arm64_sys_renameat2+0xe0/0xfc fs/namei.c:4965 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581