syzbot


possible deadlock in ext4_xattr_get

Status: upstream: reported on 2025/11/14 21:22
Reported-by: syzbot+f1e6102d1d5a5e8b3b41@syzkaller.appspotmail.com
First crash: 109d, last: 2d09h
Similar bugs (6)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in ext4_xattr_get 4 13 2d10h 82d 0/3 upstream: reported on 2025/12/11 02:47
upstream possible deadlock in ext4_xattr_get (2) ext4 4 7 89d 115d 0/29 upstream: reported on 2025/11/08 13:32
linux-4.14 possible deadlock in ext4_xattr_get 4 C inconclusive 1 1406d 1406d 0/1 upstream: reported C repro on 2022/04/27 03:33
linux-5.15 possible deadlock in ext4_xattr_get 4 13 2d09h 84d 0/3 upstream: reported on 2025/12/09 00:14
upstream possible deadlock in ext4_xattr_get ext4 4 C inconclusive 3 1031d 1304d 22/29 fixed on 2023/07/01 16:05
linux-4.19 possible deadlock in ext4_xattr_get 4 C error 1 1406d 1406d 0/1 upstream: reported C repro on 2022/04/27 05:09

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.0.871/9176 is trying to acquire lock:
ffff88805c1be4c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_xattr_get+0x10b/0x6a0 fs/ext4/xattr.c:708

but task is already holding lock:
ffff88814c6c0bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_write fs/ext4/ext4.h:1779 [inline]
ffff88814c6c0bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_ext_migrate+0x321/0x1080 fs/ext4/migrate.c:437

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+0x44/0x1a0 include/linux/percpu-rwsem.h:51
       ext4_writepages_down_read fs/ext4/ext4.h:1767 [inline]
       ext4_writepages+0x1a4/0x350 fs/ext4/inode.c:2806
       do_writepages+0x3b3/0x630 mm/page-writeback.c:2575
       __writeback_single_inode+0x153/0xec0 fs/fs-writeback.c:1635
       writeback_single_inode+0x21f/0x760 fs/fs-writeback.c:1756
       write_inode_now+0x183/0x210 fs/fs-writeback.c:2808
       iput_final fs/inode.c:1807 [inline]
       iput+0x5ae/0x920 fs/inode.c:1846
       ext4_xattr_block_set+0x273f/0x32b0 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+0x12c5/0x1e80 fs/ext4/xattr.c:2827
       __ext4_expand_extra_isize+0x306/0x400 fs/ext4/inode.c:5971
       ext4_try_to_expand_extra_isize fs/ext4/inode.c:6014 [inline]
       __ext4_mark_inode_dirty+0x45d/0x6e0 fs/ext4/inode.c:6092
       ext4_evict_inode+0x7f3/0xea0 fs/ext4/inode.c:252
       evict+0x4ca/0x8d0 fs/inode.c:705
       ext4_orphan_cleanup+0xbec/0x1420 fs/ext4/orphan.c:472
       __ext4_fill_super fs/ext4/super.c:5617 [inline]
       ext4_fill_super+0x5ed3/0x6790 fs/ext4/super.c:5740
       get_tree_bdev+0x3f3/0x520 fs/super.c:1591
       vfs_get_tree+0x8c/0x280 fs/super.c:1764
       do_new_mount+0x24b/0xa40 fs/namespace.c:3386
       do_mount fs/namespace.c:3726 [inline]
       __do_sys_mount fs/namespace.c:3935 [inline]
       __se_sys_mount+0x2e7/0x3d0 fs/namespace.c:3912
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xa0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (&ei->xattr_sem){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3134 [inline]
       check_prevs_add kernel/locking/lockdep.c:3253 [inline]
       validate_chain kernel/locking/lockdep.c:3869 [inline]
       __lock_acquire+0x2df1/0x7d40 kernel/locking/lockdep.c:5137
       lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754
       down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520
       ext4_xattr_get+0x10b/0x6a0 fs/ext4/xattr.c:708
       ext4_get_acl+0x84/0x670 fs/ext4/acl.c:165
       __get_acl+0x273/0x400 fs/posix_acl.c:160
       get_inode_acl fs/posix_acl.c:185 [inline]
       posix_acl_create+0x131/0x440 fs/posix_acl.c:648
       ext4_init_acl+0xbb/0x330 fs/ext4/acl.c:284
       __ext4_new_inode+0x2f27/0x3ac0 fs/ext4/ialloc.c:1326
       ext4_ext_migrate+0x6f0/0x1080 fs/ext4/migrate.c:455
       __ext4_ioctl fs/ext4/ioctl.c:1409 [inline]
       ext4_ioctl+0x1ee3/0x3b30 fs/ext4/ioctl.c:1627
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:871 [inline]
       __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857
       do_syscall_x64 arch/x86/entry/common.c:46 [inline]
       do_syscall_64+0x55/0xa0 arch/x86/entry/common.c:76
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

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.0.871/9176:
 #0: ffff888144b9c418 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write_file+0x63/0x200 fs/namespace.c:456
 #1: ffff88805c1bc010 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
 #1: ffff88805c1bc010 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: __ext4_ioctl fs/ext4/ioctl.c:1408 [inline]
 #1: ffff88805c1bc010 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_ioctl+0x1edb/0x3b30 fs/ext4/ioctl.c:1627
 #2: ffff88814c6c0bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_write fs/ext4/ext4.h:1779 [inline]
 #2: ffff88814c6c0bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_ext_migrate+0x321/0x1080 fs/ext4/migrate.c:437

stack backtrace:
CPU: 0 PID: 9176 Comm: syz.0.871 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
 check_noncircular+0x2fc/0x400 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 kernel/locking/lockdep.c:3869 [inline]
 __lock_acquire+0x2df1/0x7d40 kernel/locking/lockdep.c:5137
 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5754
 down_read+0x46/0x2e0 kernel/locking/rwsem.c:1520
 ext4_xattr_get+0x10b/0x6a0 fs/ext4/xattr.c:708
 ext4_get_acl+0x84/0x670 fs/ext4/acl.c:165
 __get_acl+0x273/0x400 fs/posix_acl.c:160
 get_inode_acl fs/posix_acl.c:185 [inline]
 posix_acl_create+0x131/0x440 fs/posix_acl.c:648
 ext4_init_acl+0xbb/0x330 fs/ext4/acl.c:284
 __ext4_new_inode+0x2f27/0x3ac0 fs/ext4/ialloc.c:1326
 ext4_ext_migrate+0x6f0/0x1080 fs/ext4/migrate.c:455
 __ext4_ioctl fs/ext4/ioctl.c:1409 [inline]
 ext4_ioctl+0x1ee3/0x3b30 fs/ext4/ioctl.c:1627
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:871 [inline]
 __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857
 do_syscall_x64 arch/x86/entry/common.c:46 [inline]
 do_syscall_64+0x55/0xa0 arch/x86/entry/common.c:76
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f742a39c799
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f742b25f028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f742a616090 RCX: 00007f742a39c799
RDX: 0000000000000000 RSI: 0000000000006609 RDI: 0000000000000006
RBP: 00007f742a432bd9 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f742a616128 R14: 00007f742a616090 R15: 00007fff996002c8
 </TASK>

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/03/01 12:22 linux-6.6.y 7a137e9bfa0e 43249bac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in ext4_xattr_get
2026/02/27 23:43 linux-6.6.y 7a137e9bfa0e 2cf092b8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in ext4_xattr_get
2026/01/30 19:27 linux-6.6.y 2cf6f68313dc ae7dc18c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in ext4_xattr_get
2025/12/22 21:36 linux-6.6.y 5fa4793a2d2d d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in ext4_xattr_get
2025/11/14 21:21 linux-6.6.y 0a805b6ea8cd f7988ea4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in ext4_xattr_get
* Struck through repros no longer work on HEAD.