====================================================== WARNING: possible circular locking dependency detected 6.7.0-rc1-syzkaller-00125-g7475e51b8796 #0 Not tainted ------------------------------------------------------ syz-executor.2/14617 is trying to acquire lock: ffff88808d835400 (&ea_inode->i_rwsem#7/1){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:802 [inline] ffff88808d835400 (&ea_inode->i_rwsem#7/1){+.+.}-{3:3}, at: ext4_xattr_inode_iget+0x409/0x5d0 fs/ext4/xattr.c:461 but task is already holding lock: ffff88808d836688 (&ei->i_data_sem/3){++++}-{3:3}, at: ext4_setattr+0x14bd/0x1ba0 fs/ext4/inode.c:5440 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ei->i_data_sem/3){++++}-{3:3}: lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5753 down_write+0x3a/0x50 kernel/locking/rwsem.c:1579 ext4_update_i_disksize fs/ext4/ext4.h:3381 [inline] ext4_xattr_inode_write fs/ext4/xattr.c:1446 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1594 [inline] ext4_xattr_set_entry+0x3470/0x3fc0 fs/ext4/xattr.c:1719 ext4_xattr_ibody_set+0x121/0x330 fs/ext4/xattr.c:2287 ext4_xattr_set_handle+0xba5/0x1570 fs/ext4/xattr.c:2444 ext4_xattr_set+0x241/0x3d0 fs/ext4/xattr.c:2558 __vfs_setxattr+0x460/0x4a0 fs/xattr.c:201 __vfs_setxattr_noperm+0x12e/0x5e0 fs/xattr.c:235 vfs_setxattr+0x221/0x420 fs/xattr.c:322 do_setxattr fs/xattr.c:630 [inline] setxattr+0x25d/0x2f0 fs/xattr.c:653 path_setxattr+0x1c0/0x2a0 fs/xattr.c:672 __do_sys_setxattr fs/xattr.c:688 [inline] __se_sys_setxattr fs/xattr.c:684 [inline] __x64_sys_setxattr+0xbb/0xd0 fs/xattr.c:684 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b -> #0 (&ea_inode->i_rwsem#7/1){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18e4/0x59f0 kernel/locking/lockdep.c:3868 __lock_acquire+0x1345/0x1fd0 kernel/locking/lockdep.c:5136 lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5753 down_write+0x3a/0x50 kernel/locking/rwsem.c:1579 inode_lock include/linux/fs.h:802 [inline] ext4_xattr_inode_iget+0x409/0x5d0 fs/ext4/xattr.c:461 ext4_xattr_inode_get+0x164/0x430 fs/ext4/xattr.c:535 ext4_xattr_move_to_block fs/ext4/xattr.c:2640 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2742 [inline] ext4_expand_extra_isize_ea+0xf21/0x1ce0 fs/ext4/xattr.c:2834 __ext4_expand_extra_isize+0x2f7/0x3d0 fs/ext4/inode.c:5812 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5855 [inline] __ext4_mark_inode_dirty+0x53e/0x870 fs/ext4/inode.c:5933 ext4_setattr+0x1550/0x1ba0 fs/ext4/inode.c:5443 notify_change+0xb99/0xe60 fs/attr.c:499 do_truncate+0x220/0x300 fs/open.c:66 handle_truncate fs/namei.c:3280 [inline] do_open fs/namei.c:3626 [inline] path_openat+0x29e1/0x3290 fs/namei.c:3779 do_filp_open+0x234/0x490 fs/namei.c:3809 do_sys_openat2+0x13e/0x1d0 fs/open.c:1440 do_sys_open fs/open.c:1455 [inline] __do_sys_creat fs/open.c:1531 [inline] __se_sys_creat fs/open.c:1525 [inline] __x64_sys_creat+0x123/0x160 fs/open.c:1525 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ei->i_data_sem/3); lock(&ea_inode->i_rwsem#7/1); lock(&ei->i_data_sem/3); lock(&ea_inode->i_rwsem#7/1); *** DEADLOCK *** 5 locks held by syz-executor.2/14617: #0: ffff888079a20418 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:404 #1: ffff88808d836800 (&sb->s_type->i_mutex_key#7){++++}-{3:3}, at: inode_lock include/linux/fs.h:802 [inline] #1: ffff88808d836800 (&sb->s_type->i_mutex_key#7){++++}-{3:3}, at: do_truncate+0x20c/0x300 fs/open.c:64 #2: ffff88808d8369a0 (mapping.invalidate_lock){++++}-{3:3}, at: filemap_invalidate_lock include/linux/fs.h:847 [inline] #2: ffff88808d8369a0 (mapping.invalidate_lock){++++}-{3:3}, at: ext4_setattr+0xf31/0x1ba0 fs/ext4/inode.c:5401 #3: ffff88808d836688 (&ei->i_data_sem/3){++++}-{3:3}, at: ext4_setattr+0x14bd/0x1ba0 fs/ext4/inode.c:5440 #4: ffff88808d8364c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_trylock_xattr fs/ext4/xattr.h:162 [inline] #4: ffff88808d8364c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_try_to_expand_extra_isize fs/ext4/inode.c:5852 [inline] #4: ffff88808d8364c8 (&ei->xattr_sem){++++}-{3:3}, at: __ext4_mark_inode_dirty+0x4a5/0x870 fs/ext4/inode.c:5933 stack backtrace: CPU: 1 PID: 14617 Comm: syz-executor.2 Not tainted 6.7.0-rc1-syzkaller-00125-g7475e51b8796 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 check_noncircular+0x366/0x490 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain+0x18e4/0x59f0 kernel/locking/lockdep.c:3868 __lock_acquire+0x1345/0x1fd0 kernel/locking/lockdep.c:5136 lock_acquire+0x1e3/0x530 kernel/locking/lockdep.c:5753 down_write+0x3a/0x50 kernel/locking/rwsem.c:1579 inode_lock include/linux/fs.h:802 [inline] ext4_xattr_inode_iget+0x409/0x5d0 fs/ext4/xattr.c:461 ext4_xattr_inode_get+0x164/0x430 fs/ext4/xattr.c:535 ext4_xattr_move_to_block fs/ext4/xattr.c:2640 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2742 [inline] ext4_expand_extra_isize_ea+0xf21/0x1ce0 fs/ext4/xattr.c:2834 __ext4_expand_extra_isize+0x2f7/0x3d0 fs/ext4/inode.c:5812 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5855 [inline] __ext4_mark_inode_dirty+0x53e/0x870 fs/ext4/inode.c:5933 ext4_setattr+0x1550/0x1ba0 fs/ext4/inode.c:5443 notify_change+0xb99/0xe60 fs/attr.c:499 do_truncate+0x220/0x300 fs/open.c:66 handle_truncate fs/namei.c:3280 [inline] do_open fs/namei.c:3626 [inline] path_openat+0x29e1/0x3290 fs/namei.c:3779 do_filp_open+0x234/0x490 fs/namei.c:3809 do_sys_openat2+0x13e/0x1d0 fs/open.c:1440 do_sys_open fs/open.c:1455 [inline] __do_sys_creat fs/open.c:1531 [inline] __se_sys_creat fs/open.c:1525 [inline] __x64_sys_creat+0x123/0x160 fs/open.c:1525 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7faad8c7cae9 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:00007faad9a000c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007faad8d9bf80 RCX: 00007faad8c7cae9 RDX: 0000000000000000 RSI: 0000000000000082 RDI: 0000000020002e00 RBP: 00007faad8cc847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007faad8d9bf80 R15: 00007ffe222e1828