EXT4-fs (loop0): mounted filesystem without journal. Opts: inode_readahead_blks=0x0000000000000000,nogrpid,debug_want_extra_isize=0x0000000000000066,dioread_nolock,max_batch_time=0x0000000000000008,resgid=0x0000000000000000,,errors=continue. Quota mode: writeback. ====================================================== WARNING: possible circular locking dependency detected 5.11.0-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/5864 is trying to acquire lock: ffff88802ed10e88 (&ea_inode->i_rwsem#10/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:773 [inline] ffff88802ed10e88 (&ea_inode->i_rwsem#10/1){+.+.}-{3:3}, at: ext4_xattr_inode_iget+0x1cd/0x530 fs/ext4/xattr.c:427 but task is already holding lock: ffff88802ed17078 (&ei->i_data_sem){++++}-{3:3}, at: ext4_setattr+0x1144/0x1c90 fs/ext4/inode.c:5472 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ei->i_data_sem){++++}-{3:3}: down_write+0x8d/0x150 kernel/locking/rwsem.c:1406 ext4_update_i_disksize fs/ext4/ext4.h:3273 [inline] ext4_xattr_inode_write fs/ext4/xattr.c:1389 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1525 [inline] ext4_xattr_set_entry+0x2abe/0x36d0 fs/ext4/xattr.c:1649 ext4_xattr_ibody_set+0x60/0x260 fs/ext4/xattr.c:2224 ext4_xattr_set_handle+0x6da/0x1070 fs/ext4/xattr.c:2380 ext4_xattr_set+0x11d/0x2c0 fs/ext4/xattr.c:2493 __vfs_setxattr+0xcf/0x120 fs/xattr.c:177 __vfs_setxattr_noperm+0xe6/0x470 fs/xattr.c:208 vfs_setxattr+0x10c/0x2c0 fs/xattr.c:291 setxattr+0x14e/0x250 fs/xattr.c:553 path_setxattr+0x115/0x130 fs/xattr.c:572 __do_sys_setxattr fs/xattr.c:587 [inline] __se_sys_setxattr fs/xattr.c:583 [inline] __x64_sys_setxattr+0xbb/0x150 fs/xattr.c:583 do_syscall_64+0x2d/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 -> #0 (&ea_inode->i_rwsem#10/1){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:2868 [inline] check_prevs_add kernel/locking/lockdep.c:2993 [inline] validate_chain kernel/locking/lockdep.c:3608 [inline] __lock_acquire+0x2b2a/0x5500 kernel/locking/lockdep.c:4832 lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0x1a8/0x720 kernel/locking/lockdep.c:5407 down_write+0x8d/0x150 kernel/locking/rwsem.c:1406 inode_lock include/linux/fs.h:773 [inline] ext4_xattr_inode_iget+0x1cd/0x530 fs/ext4/xattr.c:427 ext4_xattr_inode_get+0x15a/0x690 fs/ext4/xattr.c:475 ext4_xattr_move_to_block fs/ext4/xattr.c:2569 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2670 [inline] ext4_expand_extra_isize_ea+0xc07/0x1570 fs/ext4/xattr.c:2762 __ext4_expand_extra_isize+0x26f/0x3e0 fs/ext4/inode.c:5796 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5839 [inline] __ext4_mark_inode_dirty+0x42b/0x6e0 fs/ext4/inode.c:5916 ext4_setattr+0x11b0/0x1c90 fs/ext4/inode.c:5474 notify_change+0x748/0xd90 fs/attr.c:336 do_truncate+0xe3/0x190 fs/open.c:64 handle_truncate fs/namei.c:2912 [inline] do_open fs/namei.c:3258 [inline] path_openat+0x1843/0x21d0 fs/namei.c:3371 do_filp_open+0x16d/0x390 fs/namei.c:3398 do_sys_openat2+0x11e/0x360 fs/open.c:1172 do_sys_open fs/open.c:1188 [inline] __do_sys_creat fs/open.c:1262 [inline] __se_sys_creat fs/open.c:1256 [inline] __x64_sys_creat+0xc3/0x110 fs/open.c:1256 do_syscall_64+0x2d/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ei->i_data_sem); lock(&ea_inode->i_rwsem#10/1); lock(&ei->i_data_sem); lock(&ea_inode->i_rwsem#10/1); *** DEADLOCK *** 5 locks held by syz-executor.0/5864: #0: ffff888021bd0460 (sb_writers#5){.+.+}-{0:0}, at: do_open fs/namei.c:3247 [inline] #0: ffff888021bd0460 (sb_writers#5){.+.+}-{0:0}, at: path_openat+0x1618/0x21d0 fs/namei.c:3371 #1: ffff88802ed17288 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:773 [inline] #1: ffff88802ed17288 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: do_truncate+0xd4/0x190 fs/open.c:62 #2: ffff88802ed17110 (&ei->i_mmap_sem){++++}-{3:3}, at: ext4_setattr+0xb30/0x1c90 fs/ext4/inode.c:5431 #3: ffff88802ed17078 (&ei->i_data_sem){++++}-{3:3}, at: ext4_setattr+0x1144/0x1c90 fs/ext4/inode.c:5472 #4: ffff88802ed16ec8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:149 [inline] #4: ffff88802ed16ec8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:5836 [inline] #4: ffff88802ed16ec8 (&ei->xattr_sem){++++}-{3:3}, at: __ext4_mark_inode_dirty+0x3b6/0x6e0 fs/ext4/inode.c:5916 stack backtrace: CPU: 0 PID: 5864 Comm: syz-executor.0 Not tainted 5.11.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x9a/0xcc lib/dump_stack.c:120 check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2117 check_prev_add kernel/locking/lockdep.c:2868 [inline] check_prevs_add kernel/locking/lockdep.c:2993 [inline] validate_chain kernel/locking/lockdep.c:3608 [inline] __lock_acquire+0x2b2a/0x5500 kernel/locking/lockdep.c:4832 lock_acquire kernel/locking/lockdep.c:5442 [inline] lock_acquire+0x1a8/0x720 kernel/locking/lockdep.c:5407 down_write+0x8d/0x150 kernel/locking/rwsem.c:1406 inode_lock include/linux/fs.h:773 [inline] ext4_xattr_inode_iget+0x1cd/0x530 fs/ext4/xattr.c:427 ext4_xattr_inode_get+0x15a/0x690 fs/ext4/xattr.c:475 ext4_xattr_move_to_block fs/ext4/xattr.c:2569 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2670 [inline] ext4_expand_extra_isize_ea+0xc07/0x1570 fs/ext4/xattr.c:2762 __ext4_expand_extra_isize+0x26f/0x3e0 fs/ext4/inode.c:5796 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5839 [inline] __ext4_mark_inode_dirty+0x42b/0x6e0 fs/ext4/inode.c:5916 ext4_setattr+0x11b0/0x1c90 fs/ext4/inode.c:5474 notify_change+0x748/0xd90 fs/attr.c:336 do_truncate+0xe3/0x190 fs/open.c:64 handle_truncate fs/namei.c:2912 [inline] do_open fs/namei.c:3258 [inline] path_openat+0x1843/0x21d0 fs/namei.c:3371 do_filp_open+0x16d/0x390 fs/namei.c:3398 do_sys_openat2+0x11e/0x360 fs/open.c:1172 do_sys_open fs/open.c:1188 [inline] __do_sys_creat fs/open.c:1262 [inline] __se_sys_creat fs/open.c:1256 [inline] __x64_sys_creat+0xc3/0x110 fs/open.c:1256 do_syscall_64+0x2d/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f360eea5169 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f360e217168 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f360efc4f80 RCX: 00007f360eea5169 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000400 RBP: 00007f360ef00ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe164d983f R14: 00007f360e217300 R15: 0000000000022000