EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 without journal. Quota mode: none. ====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc1-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/5545 is trying to acquire lock: ffff88806fa0e648 (&ei->xattr_sem){++++}-{3:3}, at: ext4_xattr_get+0x11d/0x690 fs/ext4/xattr.c:665 but task is already holding lock: ffff88806fa0e980 (&ea_inode->i_rwsem#7/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] ffff88806fa0e980 (&ea_inode->i_rwsem#7/1){+.+.}-{3:3}, at: chown_common+0x29b/0x5e0 fs/open.c:726 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}: down_write+0x90/0x220 kernel/locking/rwsem.c:1562 inode_lock include/linux/fs.h:756 [inline] ext4_xattr_inode_create fs/ext4/xattr.c:1457 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1540 [inline] ext4_xattr_set_entry+0x28af/0x3970 fs/ext4/xattr.c:1669 ext4_xattr_ibody_set+0xfa/0x330 fs/ext4/xattr.c:2221 ext4_xattr_set_handle+0x71c/0x10f0 fs/ext4/xattr.c:2378 ext4_xattr_set+0x123/0x2e0 fs/ext4/xattr.c:2492 __vfs_setxattr+0x109/0x160 fs/xattr.c:202 __vfs_setxattr_noperm+0xee/0x590 fs/xattr.c:236 vfs_setxattr+0x111/0x2d0 fs/xattr.c:323 setxattr+0x106/0x120 fs/xattr.c:631 path_setxattr+0x13c/0x170 fs/xattr.c:650 __do_sys_setxattr fs/xattr.c:666 [inline] __se_sys_setxattr fs/xattr.c:662 [inline] __x64_sys_setxattr+0xbb/0x150 fs/xattr.c:662 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 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:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1df/0x630 kernel/locking/lockdep.c:5633 down_read+0x98/0x450 kernel/locking/rwsem.c:1509 ext4_xattr_get+0x11d/0x690 fs/ext4/xattr.c:665 __vfs_getxattr+0xe6/0x140 fs/xattr.c:425 cap_inode_need_killpriv+0x37/0x50 security/commoncap.c:301 security_inode_need_killpriv+0x34/0x70 security/security.c:1492 notify_change+0x631/0xfb0 fs/attr.c:415 chown_common+0x4c5/0x5e0 fs/open.c:736 do_fchownat+0xcf/0x140 fs/open.c:767 __do_sys_fchownat fs/open.c:782 [inline] __se_sys_fchownat fs/open.c:779 [inline] __x64_sys_fchownat+0xb5/0x150 fs/open.c:779 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/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(&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-executor.0/5545: #0: ffff88802aa18460 (sb_writers#5){.+.+}-{0:0}, at: do_fchownat+0xb8/0x140 fs/open.c:764 #1: ffff88806fa0e980 (&ea_inode->i_rwsem#7/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] #1: ffff88806fa0e980 (&ea_inode->i_rwsem#7/1){+.+.}-{3:3}, at: chown_common+0x29b/0x5e0 fs/open.c:726 stack backtrace: CPU: 1 PID: 5545 Comm: syz-executor.0 Not tainted 6.2.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x57/0x7d lib/dump_stack.c:106 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2177 check_prev_add kernel/locking/lockdep.c:3097 [inline] check_prevs_add kernel/locking/lockdep.c:3216 [inline] validate_chain kernel/locking/lockdep.c:3831 [inline] __lock_acquire+0x2a43/0x56d0 kernel/locking/lockdep.c:5055 lock_acquire kernel/locking/lockdep.c:5668 [inline] lock_acquire+0x1df/0x630 kernel/locking/lockdep.c:5633 down_read+0x98/0x450 kernel/locking/rwsem.c:1509 ext4_xattr_get+0x11d/0x690 fs/ext4/xattr.c:665 __vfs_getxattr+0xe6/0x140 fs/xattr.c:425 cap_inode_need_killpriv+0x37/0x50 security/commoncap.c:301 security_inode_need_killpriv+0x34/0x70 security/security.c:1492 notify_change+0x631/0xfb0 fs/attr.c:415 chown_common+0x4c5/0x5e0 fs/open.c:736 do_fchownat+0xcf/0x140 fs/open.c:767 __do_sys_fchownat fs/open.c:782 [inline] __se_sys_fchownat fs/open.c:779 [inline] __x64_sys_fchownat+0xb5/0x150 fs/open.c:779 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fdca76893c9 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdca8701168 EFLAGS: 00000246 ORIG_RAX: 0000000000000104 RAX: ffffffffffffffda RBX: 00007fdca779bf80 RCX: 00007fdca76893c9 RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000005 RBP: 00007fdca76e433f R08: 0000000000001000 R09: 0000000000000000 R10: 000000000000ee01 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fffd4d3095f R14: 00007fdca8701300 R15: 0000000000022000