====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.9.3708/22746 is trying to acquire lock: ffff8880518e2708 (&ei->xattr_sem){++++}-{4:4}, at: ext4_xattr_get+0x14d/0x780 fs/ext4/xattr.c:708 but task is already holding lock: ffff8880672aeb98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_write fs/ext4/ext4.h:1808 [inline] ffff8880672aeb98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_ext_migrate+0x39c/0x1ee0 fs/ext4/migrate.c:438 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&sbi->s_writepages_rwsem){++++}-{0:0}: percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline] percpu_down_read include/linux/percpu-rwsem.h:77 [inline] ext4_writepages_down_read fs/ext4/ext4.h:1796 [inline] ext4_writepages+0x224/0x7d0 fs/ext4/inode.c:3020 do_writepages+0x27a/0x600 mm/page-writeback.c:2598 __writeback_single_inode+0x168/0x14a0 fs/fs-writeback.c:1737 writeback_single_inode+0x5ea/0x11f0 fs/fs-writeback.c:1858 write_inode_now+0x170/0x1e0 fs/fs-writeback.c:2924 iput_final fs/inode.c:1941 [inline] iput.part.0+0x815/0x1190 fs/inode.c:2003 iput+0x35/0x40 fs/inode.c:1966 ext4_xattr_block_set+0x67c/0x3640 fs/ext4/xattr.c:2199 ext4_xattr_move_to_block fs/ext4/xattr.c:2664 [inline] ext4_xattr_make_inode_space fs/ext4/xattr.c:2739 [inline] ext4_expand_extra_isize_ea+0x1442/0x1ab0 fs/ext4/xattr.c:2827 __ext4_expand_extra_isize+0x346/0x480 fs/ext4/inode.c:6360 ext4_try_to_expand_extra_isize fs/ext4/inode.c:6403 [inline] __ext4_mark_inode_dirty+0x544/0x840 fs/ext4/inode.c:6481 ext4_evict_inode+0x713/0x1730 fs/ext4/inode.c:253 evict+0x3c2/0xad0 fs/inode.c:837 iput_final fs/inode.c:1951 [inline] iput.part.0+0x621/0x1190 fs/inode.c:2003 iput+0x35/0x40 fs/inode.c:1966 ext4_orphan_cleanup+0x731/0x11e0 fs/ext4/orphan.c:470 __ext4_fill_super fs/ext4/super.c:5617 [inline] ext4_fill_super+0x91b3/0xb670 fs/ext4/super.c:5736 get_tree_bdev_flags+0x38c/0x620 fs/super.c:1699 vfs_get_tree+0x8e/0x330 fs/super.c:1759 fc_mount fs/namespace.c:1199 [inline] do_new_mount_fc fs/namespace.c:3636 [inline] do_new_mount fs/namespace.c:3712 [inline] path_mount+0x7bf/0x23a0 fs/namespace.c:4022 do_mount fs/namespace.c:4035 [inline] __do_sys_mount fs/namespace.c:4224 [inline] __se_sys_mount fs/namespace.c:4201 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:4201 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&ei->xattr_sem){++++}-{4:4}: check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x1542/0x22f0 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x179/0x330 kernel/locking/lockdep.c:5825 down_read+0x9b/0x460 kernel/locking/rwsem.c:1537 ext4_xattr_get+0x14d/0x780 fs/ext4/xattr.c:708 ext4_get_acl+0x7d/0x670 fs/ext4/acl.c:165 __get_acl+0x379/0x4d0 fs/posix_acl.c:159 get_inode_acl fs/posix_acl.c:184 [inline] posix_acl_create+0x144/0x580 fs/posix_acl.c:646 ext4_init_acl+0x9a/0x300 fs/ext4/acl.c:284 __ext4_new_inode+0x3fdb/0x4eb0 fs/ext4/ialloc.c:1321 ext4_ext_migrate+0x6fa/0x1ee0 fs/ext4/migrate.c:456 __ext4_ioctl+0x3178/0x4410 fs/ext4/ioctl.c:1694 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sbi->s_writepages_rwsem); lock(&ei->xattr_sem); lock(&sbi->s_writepages_rwsem); rlock(&ei->xattr_sem); *** DEADLOCK *** 3 locks held by syz.9.3708/22746: #0: ffff88804d578420 (sb_writers#4){++++}-{0:0}, at: __ext4_ioctl+0x3146/0x4410 fs/ext4/ioctl.c:1684 #1: ffff88804b95f6a0 (&sb->s_type->i_mutex_key#10){++++}-{4:4}, at: inode_lock include/linux/fs.h:1027 [inline] #1: ffff88804b95f6a0 (&sb->s_type->i_mutex_key#10){++++}-{4:4}, at: __ext4_ioctl+0x3170/0x4410 fs/ext4/ioctl.c:1693 #2: ffff8880672aeb98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_write fs/ext4/ext4.h:1808 [inline] #2: ffff8880672aeb98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_ext_migrate+0x39c/0x1ee0 fs/ext4/migrate.c:438 stack backtrace: CPU: 1 UID: 0 PID: 22746 Comm: syz.9.3708 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x2db/0x410 kernel/locking/lockdep.c:2043 check_noncircular+0x146/0x160 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3165 [inline] check_prevs_add kernel/locking/lockdep.c:3284 [inline] validate_chain kernel/locking/lockdep.c:3908 [inline] __lock_acquire+0x1542/0x22f0 kernel/locking/lockdep.c:5237 lock_acquire kernel/locking/lockdep.c:5868 [inline] lock_acquire+0x179/0x330 kernel/locking/lockdep.c:5825 down_read+0x9b/0x460 kernel/locking/rwsem.c:1537 ext4_xattr_get+0x14d/0x780 fs/ext4/xattr.c:708 ext4_get_acl+0x7d/0x670 fs/ext4/acl.c:165 __get_acl+0x379/0x4d0 fs/posix_acl.c:159 get_inode_acl fs/posix_acl.c:184 [inline] posix_acl_create+0x144/0x580 fs/posix_acl.c:646 ext4_init_acl+0x9a/0x300 fs/ext4/acl.c:284 __ext4_new_inode+0x3fdb/0x4eb0 fs/ext4/ialloc.c:1321 ext4_ext_migrate+0x6fa/0x1ee0 fs/ext4/migrate.c:456 __ext4_ioctl+0x3178/0x4410 fs/ext4/ioctl.c:1694 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fef0d18f749 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fef0df6a038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fef0d3e6090 RCX: 00007fef0d18f749 RDX: 0000000000000000 RSI: 0000000000006609 RDI: 0000000000000004 RBP: 00007fef0d213f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fef0d3e6128 R14: 00007fef0d3e6090 R15: 00007ffd2e5bb648