syzbot


possible deadlock in ext4_xattr_get

Status: upstream: reported on 2025/12/09 00:14
Reported-by: syzbot+eed4523656a9db7f6178@syzkaller.appspotmail.com
First crash: 51d, last: 6d12h
Similar bugs (6)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.6 possible deadlock in ext4_xattr_get 4 2 37d 75d 0/2 upstream: reported on 2025/11/14 21:22
linux-6.1 possible deadlock in ext4_xattr_get 4 1 49d 49d 0/3 upstream: reported on 2025/12/11 02:47
upstream possible deadlock in ext4_xattr_get (2) ext4 4 7 56d 82d 0/29 upstream: reported on 2025/11/08 13:32
linux-4.14 possible deadlock in ext4_xattr_get 4 C inconclusive 1 1373d 1373d 0/1 upstream: reported C repro on 2022/04/27 03:33
upstream possible deadlock in ext4_xattr_get ext4 4 C inconclusive 3 998d 1271d 22/29 fixed on 2023/07/01 16:05
linux-4.19 possible deadlock in ext4_xattr_get 4 C error 1 1373d 1373d 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.6.1488/9570 is trying to acquire lock:
ffff88805d81e478 (&ei->xattr_sem){++++}-{3:3}, at: ext4_xattr_get+0xfc/0x800 fs/ext4/xattr.c:654

but task is already holding lock:
ffff888077082bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_ext_migrate+0x2d7/0xe60 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+0x46/0x1b0 include/linux/percpu-rwsem.h:51
       ext4_writepages+0x20f/0x2df0 fs/ext4/inode.c:2689
       do_writepages+0x476/0x6e0 mm/page-writeback.c:2386
       __writeback_single_inode+0x153/0xda0 fs/fs-writeback.c:1657
       writeback_single_inode+0x3cb/0x8e0 fs/fs-writeback.c:1770
       write_inode_now+0x23b/0x2c0 fs/fs-writeback.c:2811
       iput_final fs/inode.c:1756 [inline]
       iput+0x5ab/0x8a0 fs/inode.c:1795
       ext4_xattr_set_entry+0x34f4/0x3ea0 fs/ext4/xattr.c:1824
       ext4_xattr_block_set+0x4fd/0x2d20 fs/ext4/xattr.c:1923
       ext4_xattr_move_to_block fs/ext4/xattr.c:2617 [inline]
       ext4_xattr_make_inode_space fs/ext4/xattr.c:2692 [inline]
       ext4_expand_extra_isize_ea+0xf3f/0x19b0 fs/ext4/xattr.c:2780
       __ext4_expand_extra_isize+0x301/0x3e0 fs/ext4/inode.c:5905
       ext4_try_to_expand_extra_isize fs/ext4/inode.c:5948 [inline]
       __ext4_mark_inode_dirty+0x469/0x700 fs/ext4/inode.c:6026
       ext4_evict_inode+0xa8d/0x1090 fs/ext4/inode.c:282
       evict+0x4c9/0x8d0 fs/inode.c:647
       ext4_orphan_cleanup+0xad2/0x1320 fs/ext4/orphan.c:472
       ext4_fill_super+0x8e25/0x95a0 fs/ext4/super.c:5000
       mount_bdev+0x287/0x3c0 fs/super.c:1400
       legacy_get_tree+0xe6/0x180 fs/fs_context.c:611
       vfs_get_tree+0x88/0x270 fs/super.c:1530
       do_new_mount+0x24a/0xa40 fs/namespace.c:3034
       do_mount fs/namespace.c:3377 [inline]
       __do_sys_mount fs/namespace.c:3585 [inline]
       __se_sys_mount+0x2e3/0x3d0 fs/namespace.c:3562
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #0 (&ei->xattr_sem){++++}-{3:3}:
       check_prev_add kernel/locking/lockdep.c:3053 [inline]
       check_prevs_add kernel/locking/lockdep.c:3172 [inline]
       validate_chain kernel/locking/lockdep.c:3788 [inline]
       __lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012
       lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
       down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498
       ext4_xattr_get+0xfc/0x800 fs/ext4/xattr.c:654
       ext4_get_acl+0x80/0x660 fs/ext4/acl.c:165
       get_acl+0x154/0x250 fs/posix_acl.c:153
       posix_acl_create+0x124/0x430 fs/posix_acl.c:632
       ext4_init_acl+0xb7/0x330 fs/ext4/acl.c:283
       __ext4_new_inode+0x2eb3/0x3a40 fs/ext4/ialloc.c:1328
       ext4_ext_migrate+0x5f1/0xe60 fs/ext4/migrate.c:456
       __ext4_ioctl fs/ext4/ioctl.c:1028 [inline]
       ext4_ioctl+0x1a84/0x3820 fs/ext4/ioctl.c:1282
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:874 [inline]
       __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

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);
  lock(&ei->xattr_sem);

 *** DEADLOCK ***

3 locks held by syz.6.1488/9570:
 #0: ffff88801f296460 (sb_writers#5){.+.+}-{0:0}, at: mnt_want_write_file+0x5c/0x200 fs/namespace.c:430
 #1: ffff88805d9fabd0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
 #1: ffff88805d9fabd0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: __ext4_ioctl fs/ext4/ioctl.c:1027 [inline]
 #1: ffff88805d9fabd0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_ioctl+0x1a7c/0x3820 fs/ext4/ioctl.c:1282
 #2: ffff888077082bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_ext_migrate+0x2d7/0xe60 fs/ext4/migrate.c:438

stack backtrace:
CPU: 1 PID: 9570 Comm: syz.6.1488 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
 check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2133
 check_prev_add kernel/locking/lockdep.c:3053 [inline]
 check_prevs_add kernel/locking/lockdep.c:3172 [inline]
 validate_chain kernel/locking/lockdep.c:3788 [inline]
 __lock_acquire+0x2c42/0x7d10 kernel/locking/lockdep.c:5012
 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5623
 down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498
 ext4_xattr_get+0xfc/0x800 fs/ext4/xattr.c:654
 ext4_get_acl+0x80/0x660 fs/ext4/acl.c:165
 get_acl+0x154/0x250 fs/posix_acl.c:153
 posix_acl_create+0x124/0x430 fs/posix_acl.c:632
 ext4_init_acl+0xb7/0x330 fs/ext4/acl.c:283
 __ext4_new_inode+0x2eb3/0x3a40 fs/ext4/ialloc.c:1328
 ext4_ext_migrate+0x5f1/0xe60 fs/ext4/migrate.c:456
 __ext4_ioctl fs/ext4/ioctl.c:1028 [inline]
 ext4_ioctl+0x1a84/0x3820 fs/ext4/ioctl.c:1282
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fb3e3a13cb9
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:00007fb3e1c4e028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fb3e3c8f090 RCX: 00007fb3e3a13cb9
RDX: 0000000000000000 RSI: 0000000000006609 RDI: 0000000000000004
RBP: 00007fb3e3a81bf7 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fb3e3c8f128 R14: 00007fb3e3c8f090 R15: 00007ffe1ca3bee8
 </TASK>

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/01/23 03:07 linux-5.15.y 9eec9a14ee10 82c9c083 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ext4_xattr_get
2026/01/08 12:08 linux-5.15.y 68efe5a6c16a d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ext4_xattr_get
2025/12/22 07:28 linux-5.15.y 68efe5a6c16a d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ext4_xattr_get
2025/12/09 00:13 linux-5.15.y 68efe5a6c16a d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in ext4_xattr_get
* Struck through repros no longer work on HEAD.