loop0: detected capacity change from 0 to 40427 F2FS-fs (loop0): Found nat_bits in checkpoint F2FS-fs (loop0): Mounted with checkpoint version = 48b305e5 ====================================================== WARNING: possible circular locking dependency detected 6.4.0-next-20230703-syzkaller-dirty #0 Not tainted ------------------------------------------------------ syz-executor.0/5443 is trying to acquire lock: ffff8880757ebcd8 (&fi->i_xattr_sem){++++}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline] ffff8880757ebcd8 (&fi->i_xattr_sem){++++}-{3:3}, at: f2fs_getxattr+0xb1e/0x12c0 fs/f2fs/xattr.c:532 but task is already holding lock: ffff8880757ec310 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline] ffff8880757ec310 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x22/0x1d0 fs/f2fs/dir.c:838 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&fi->i_sem){+.+.}-{3:3}: down_write+0x93/0x200 kernel/locking/rwsem.c:1573 f2fs_down_write fs/f2fs/f2fs.h:2133 [inline] f2fs_add_inline_entry+0x300/0x6f0 fs/f2fs/inline.c:644 f2fs_add_dentry+0xa6/0x230 fs/f2fs/dir.c:784 f2fs_do_add_link+0x190/0x280 fs/f2fs/dir.c:827 f2fs_add_link fs/f2fs/f2fs.h:3554 [inline] f2fs_mkdir+0x377/0x620 fs/f2fs/namei.c:781 vfs_mkdir+0x532/0x7e0 fs/namei.c:4117 ovl_do_mkdir fs/overlayfs/overlayfs.h:196 [inline] ovl_mkdir_real+0xb5/0x370 fs/overlayfs/dir.c:146 ovl_workdir_create+0x3de/0x820 fs/overlayfs/super.c:309 ovl_make_workdir fs/overlayfs/super.c:711 [inline] ovl_get_workdir fs/overlayfs/super.c:864 [inline] ovl_fill_super+0xdab/0x6180 fs/overlayfs/super.c:1400 vfs_get_super+0xf9/0x290 fs/super.c:1152 vfs_get_tree+0x88/0x350 fs/super.c:1519 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&fi->i_xattr_sem){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3142 [inline] check_prevs_add kernel/locking/lockdep.c:3261 [inline] validate_chain kernel/locking/lockdep.c:3876 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5144 lock_acquire kernel/locking/lockdep.c:5761 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5726 down_read+0x9c/0x470 kernel/locking/rwsem.c:1520 f2fs_down_read fs/f2fs/f2fs.h:2108 [inline] f2fs_getxattr+0xb1e/0x12c0 fs/f2fs/xattr.c:532 __f2fs_get_acl+0x5a/0x900 fs/f2fs/acl.c:179 f2fs_acl_create fs/f2fs/acl.c:377 [inline] f2fs_init_acl+0x15c/0xb30 fs/f2fs/acl.c:420 f2fs_init_inode_metadata+0x159/0x1290 fs/f2fs/dir.c:558 f2fs_do_tmpfile+0x31/0x1d0 fs/f2fs/dir.c:839 __f2fs_tmpfile+0x1e6/0x460 fs/f2fs/namei.c:884 f2fs_tmpfile+0x178/0x250 fs/f2fs/namei.c:935 vfs_tmpfile+0x2b1/0x4d0 fs/namei.c:3687 kernel_tmpfile_open+0x59/0x90 fs/namei.c:3729 ovl_do_tmpfile fs/overlayfs/overlayfs.h:339 [inline] ovl_make_workdir fs/overlayfs/super.c:737 [inline] ovl_get_workdir fs/overlayfs/super.c:864 [inline] ovl_fill_super+0xfd1/0x6180 fs/overlayfs/super.c:1400 vfs_get_super+0xf9/0x290 fs/super.c:1152 vfs_get_tree+0x88/0x350 fs/super.c:1519 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd 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); rlock(&fi->i_xattr_sem); *** DEADLOCK *** 4 locks held by syz-executor.0/5443: #0: ffff88807e1320e0 (&type->s_umount_key#50/1){+.+.}-{3:3}, at: alloc_super+0x22e/0xb40 fs/super.c:228 #1: ffff888077810410 (sb_writers#13){.+.+}-{0:0}, at: ovl_make_workdir fs/overlayfs/super.c:707 [inline] #1: ffff888077810410 (sb_writers#13){.+.+}-{0:0}, at: ovl_get_workdir fs/overlayfs/super.c:864 [inline] #1: ffff888077810410 (sb_writers#13){.+.+}-{0:0}, at: ovl_fill_super+0xd7c/0x6180 fs/overlayfs/super.c:1400 #2: ffff88807ab683b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2108 [inline] #2: ffff88807ab683b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: f2fs_lock_op fs/f2fs/f2fs.h:2151 [inline] #2: ffff88807ab683b0 (&sbi->cp_rwsem){.+.+}-{3:3}, at: __f2fs_tmpfile+0x1bb/0x460 fs/f2fs/namei.c:879 #3: ffff8880757ec310 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2133 [inline] #3: ffff8880757ec310 (&fi->i_sem){+.+.}-{3:3}, at: f2fs_do_tmpfile+0x22/0x1d0 fs/f2fs/dir.c:838 stack backtrace: CPU: 1 PID: 5443 Comm: syz-executor.0 Not tainted 6.4.0-next-20230703-syzkaller-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x311/0x3f0 kernel/locking/lockdep.c:2195 check_prev_add kernel/locking/lockdep.c:3142 [inline] check_prevs_add kernel/locking/lockdep.c:3261 [inline] validate_chain kernel/locking/lockdep.c:3876 [inline] __lock_acquire+0x2e3d/0x5de0 kernel/locking/lockdep.c:5144 lock_acquire kernel/locking/lockdep.c:5761 [inline] lock_acquire+0x1ae/0x510 kernel/locking/lockdep.c:5726 down_read+0x9c/0x470 kernel/locking/rwsem.c:1520 f2fs_down_read fs/f2fs/f2fs.h:2108 [inline] f2fs_getxattr+0xb1e/0x12c0 fs/f2fs/xattr.c:532 __f2fs_get_acl+0x5a/0x900 fs/f2fs/acl.c:179 f2fs_acl_create fs/f2fs/acl.c:377 [inline] f2fs_init_acl+0x15c/0xb30 fs/f2fs/acl.c:420 f2fs_init_inode_metadata+0x159/0x1290 fs/f2fs/dir.c:558 f2fs_do_tmpfile+0x31/0x1d0 fs/f2fs/dir.c:839 __f2fs_tmpfile+0x1e6/0x460 fs/f2fs/namei.c:884 f2fs_tmpfile+0x178/0x250 fs/f2fs/namei.c:935 vfs_tmpfile+0x2b1/0x4d0 fs/namei.c:3687 kernel_tmpfile_open+0x59/0x90 fs/namei.c:3729 ovl_do_tmpfile fs/overlayfs/overlayfs.h:339 [inline] ovl_make_workdir fs/overlayfs/super.c:737 [inline] ovl_get_workdir fs/overlayfs/super.c:864 [inline] ovl_fill_super+0xfd1/0x6180 fs/overlayfs/super.c:1400 vfs_get_super+0xf9/0x290 fs/super.c:1152 vfs_get_tree+0x88/0x350 fs/super.c:1519 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fb53e87cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb53f5660c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fb53e99bf80 RCX: 00007fb53e87cae9 RDX: 0000000020000280 RSI: 0000000020000040 RDI: 0000000000000000 RBP: 00007fb53e8c847a R08: 0000000020000180 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fb53e99bf80 R15: 00007ffe7d1e58d8