loop0: detected capacity change from 0 to 512 EXT4-fs (loop0): mounted filesystem without journal. Quota mode: none. ====================================================== WARNING: possible circular locking dependency detected 5.19.0-syzkaller-13930-g7ebfc85e2cd7 #0 Not tainted ------------------------------------------------------ syz-executor424/3607 is trying to acquire lock: ffff8880741414d8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_xattr_get+0x103/0x7f0 fs/ext4/xattr.c:665 but task is already holding lock: ffff888074141810 (&ea_inode->i_rwsem#7/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:761 [inline] ffff888074141810 (&ea_inode->i_rwsem#7/1){+.+.}-{3:3}, at: chown_common+0x3f5/0x8a0 fs/open.c:727 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ea_inode->i_rwsem#7/1){+.+.}-{3:3}: lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666 down_write+0x95/0x170 kernel/locking/rwsem.c:1552 inode_lock include/linux/fs.h:761 [inline] ext4_xattr_inode_create fs/ext4/xattr.c:1454 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1537 [inline] ext4_xattr_set_entry+0x316d/0x3ae0 fs/ext4/xattr.c:1665 ext4_xattr_ibody_set+0x128/0x360 fs/ext4/xattr.c:2225 ext4_xattr_set_handle+0xc59/0x1590 fs/ext4/xattr.c:2382 ext4_xattr_set+0x23e/0x3e0 fs/ext4/xattr.c:2495 __vfs_setxattr+0x3f4/0x430 fs/xattr.c:182 __vfs_setxattr_noperm+0x128/0x5d0 fs/xattr.c:216 vfs_setxattr+0x2bc/0x4e0 fs/xattr.c:313 do_setxattr fs/xattr.c:600 [inline] setxattr fs/xattr.c:623 [inline] path_setxattr+0x3b0/0x4b0 fs/xattr.c:642 __do_sys_setxattr fs/xattr.c:658 [inline] __se_sys_setxattr fs/xattr.c:654 [inline] __x64_sys_setxattr+0xb7/0xd0 fs/xattr.c:654 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&ei->xattr_sem){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain+0x1872/0x6600 kernel/locking/lockdep.c:3829 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5053 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666 down_read+0x39/0x50 kernel/locking/rwsem.c:1499 ext4_xattr_get+0x103/0x7f0 fs/ext4/xattr.c:665 __vfs_getxattr+0x3de/0x410 fs/xattr.c:411 cap_inode_need_killpriv+0x41/0x60 security/commoncap.c:301 security_inode_need_killpriv+0x50/0xb0 security/security.c:1420 notify_change+0x4e1/0x10f0 fs/attr.c:353 chown_common+0x576/0x8a0 fs/open.c:734 do_fchownat+0x175/0x250 fs/open.c:765 __do_sys_fchownat fs/open.c:780 [inline] __se_sys_fchownat fs/open.c:777 [inline] __x64_sys_fchownat+0xb1/0xc0 fs/open.c:777 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 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(&ea_inode->i_rwsem#7/1); lock(&ei->xattr_sem); lock(&ea_inode->i_rwsem#7/1); lock(&ei->xattr_sem); *** DEADLOCK *** 2 locks held by syz-executor424/3607: #0: ffff888022e78460 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:393 #1: ffff888074141810 (&ea_inode->i_rwsem#7/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:761 [inline] #1: ffff888074141810 (&ea_inode->i_rwsem#7/1){+.+.}-{3:3}, at: chown_common+0x3f5/0x8a0 fs/open.c:727 stack backtrace: CPU: 0 PID: 3607 Comm: syz-executor424 Not tainted 5.19.0-syzkaller-13930-g7ebfc85e2cd7 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 check_noncircular+0x2f9/0x3b0 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain+0x1872/0x6600 kernel/locking/lockdep.c:3829 __lock_acquire+0x1292/0x1f60 kernel/locking/lockdep.c:5053 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5666 down_read+0x39/0x50 kernel/locking/rwsem.c:1499 ext4_xattr_get+0x103/0x7f0 fs/ext4/xattr.c:665 __vfs_getxattr+0x3de/0x410 fs/xattr.c:411 cap_inode_need_killpriv+0x41/0x60 security/commoncap.c:301 security_inode_need_killpriv+0x50/0xb0 security/security.c:1420 notify_change+0x4e1/0x10f0 fs/attr.c:353 chown_common+0x576/0x8a0 fs/open.c:734 do_fchownat+0x175/0x250 fs/open.c:765 __do_sys_fchownat fs/open.c:780 [inline] __se_sys_fchownat fs/open.c:777 [inline] __x64_sys_fchownat+0xb1/0xc0 fs/open.c:777 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fd1f824d0e9 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 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffd0eb20998 EFLAGS: 00000246 ORIG_RAX: 0