syzbot
possible deadlock in ext4_xattr_get
Status:
upstream: reported C repro on 2025/12/09 00:14
Bug presence:
origin:upstream
[Documentation on labels]
Reported-by: syzbot+eed4523656a9db7f6178@syzkaller.appspotmail.com
First crash: 226d, last: 6d02h
▶
▼
Bug presence (1)
| Date |
Name |
Commit |
Repro |
Result |
| 2026/05/24 |
upstream (ToT) |
4cbfe4502e3d |
C
|
[report] possible deadlock in ext4_evict_inode
|
▶
▼
Last patch testing requests (1)
▶
▼
Fix bisection attempts (1)
Sample crash report:
EXT4-fs (loop0): mounted filesystem without journal. Opts: grpquota,nogrpid,quota,,errors=continue. Quota mode: writeback.
ext4 filesystem being mounted at /3/file1 supports timestamps until 2038-01-19 (0x7fffffff)
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.0.20/4317 is trying to acquire lock:
ffff88806f35b2a0 (&ei->xattr_sem){++++}-{3:3}, at: ext4_xattr_get+0xfc/0x800 fs/ext4/xattr.c:654
but task is already holding lock:
ffff88807b6d4c58 (&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:2691
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:2817
iput_final fs/inode.c:1756 [inline]
iput+0x5ab/0x8a0 fs/inode.c:1795
ext4_xattr_set_entry+0x34f4/0x3ea0 fs/ext4/xattr.c:1825
ext4_xattr_block_set+0x979/0x2d20 fs/ext4/xattr.c:1993
ext4_xattr_move_to_block fs/ext4/xattr.c:2618 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2693 [inline]
ext4_expand_extra_isize_ea+0xf3f/0x19b0 fs/ext4/xattr.c:2781
__ext4_expand_extra_isize+0x301/0x3e0 fs/ext4/inode.c:5924
ext4_try_to_expand_extra_isize fs/ext4/inode.c:5967 [inline]
__ext4_mark_inode_dirty+0x469/0x700 fs/ext4/inode.c:6045
ext4_evict_inode+0xa8d/0x1090 fs/ext4/inode.c:284
evict+0x4c9/0x8d0 fs/inode.c:647
ext4_orphan_cleanup+0xad2/0x1320 fs/ext4/orphan.c:472
ext4_fill_super+0x8d6e/0x94f0 fs/ext4/super.c:5006
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:1334
ext4_ext_migrate+0x5f1/0xe60 fs/ext4/migrate.c:456
__ext4_ioctl fs/ext4/ioctl.c:1031 [inline]
ext4_ioctl+0x1a84/0x3870 fs/ext4/ioctl.c:1285
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.0.20/4317:
#0: ffff88807b6d2460 (sb_writers#5){.+.+}-{0:0}, at: mnt_want_write_file+0x5c/0x200 fs/namespace.c:430
#1: ffff88806f2f83f0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
#1: ffff88806f2f83f0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: __ext4_ioctl fs/ext4/ioctl.c:1030 [inline]
#1: ffff88806f2f83f0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_ioctl+0x1a7c/0x3870 fs/ext4/ioctl.c:1285
#2: ffff88807b6d4c58 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_ext_migrate+0x2d7/0xe60 fs/ext4/migrate.c:438
stack backtrace:
CPU: 1 PID: 4317 Comm: syz.0.20 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
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:1334
ext4_ext_migrate+0x5f1/0xe60 fs/ext4/migrate.c:456
__ext4_ioctl fs/ext4/ioctl.c:1031 [inline]
ext4_ioctl+0x1a84/0x3870 fs/ext4/ioctl.c:1285
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:0x7fb596185dd9
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:00007ffccd0769d8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fb5963fefa0 RCX: 00007fb596185dd9
RDX: 0000000000000000 RSI: 0000000000006609 RDI: 0000000000000004
RBP: 00007fb59621bd69 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fb5963fefac R14: 00007fb5963fefa0 R15: 00007fb5963fefa0
</TASK>
* Struck through repros no longer work on HEAD.