syzbot


possible deadlock in evict (4)

Status: upstream: reported on 2025/11/26 23:09
Subsystems: ext4
[Documentation on labels]
Reported-by: syzbot+a30a00d3e694e4fa1315@syzkaller.appspotmail.com
First crash: 5d20h, last: 2d10h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [ext4?] possible deadlock in evict (4) 0 (1) 2025/11/26 23:09
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in evict (2) ext4 4 39 1014d 1317d 0/29 closed as dup on 2022/04/21 19:37
upstream possible deadlock in evict ext4 4 3 1721d 1749d 0/29 auto-closed as invalid on 2021/07/11 09:40
upstream possible deadlock in evict (3) ext4 4 569 520d 1004d 0/29 auto-obsoleted due to no activity on 2024/09/04 11:02

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.4.5384/26557 is trying to acquire lock:
ffff88805de42610 (sb_internal){.+.+}-{0:0}, at: evict+0x3e6/0x920 fs/inode.c:810

but task is already holding lock:
ffff88807c0ccb98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_write fs/ext4/ext4.h:1808 [inline]
ffff88807c0ccb98 (&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:3024
       do_writepages+0x27a/0x600 mm/page-writeback.c:2604
       __writeback_single_inode+0x160/0xfb0 fs/fs-writeback.c:1719
       writeback_single_inode+0x2bc/0x550 fs/fs-writeback.c:1840
       write_inode_now+0x170/0x1e0 fs/fs-writeback.c:2903
       iput_final fs/inode.c:1901 [inline]
       iput.part.0+0x487/0xb00 fs/inode.c:1966
       iput+0x35/0x40 fs/inode.c:1929
       ext4_xattr_block_set+0x67c/0x3650 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:6364
       ext4_try_to_expand_extra_isize fs/ext4/inode.c:6407 [inline]
       __ext4_mark_inode_dirty+0x544/0x870 fs/ext4/inode.c:6485
       ext4_evict_inode+0x74e/0x18e0 fs/ext4/inode.c:254
       evict+0x3e6/0x920 fs/inode.c:810
       iput_final fs/inode.c:1914 [inline]
       iput.part.0+0x6a9/0xb00 fs/inode.c:1966
       iput+0x35/0x40 fs/inode.c:1929
       ext4_orphan_cleanup+0x731/0x11e0 fs/ext4/orphan.c:470
       __ext4_fill_super fs/ext4/super.c:5617 [inline]
       ext4_fill_super+0x8db7/0xaf70 fs/ext4/super.c:5736
       get_tree_bdev_flags+0x38c/0x620 fs/super.c:1698
       vfs_get_tree+0x8e/0x340 fs/super.c:1758
       fc_mount fs/namespace.c:1199 [inline]
       do_new_mount_fc fs/namespace.c:3642 [inline]
       do_new_mount fs/namespace.c:3718 [inline]
       path_mount+0x7b9/0x23a0 fs/namespace.c:4028
       do_mount fs/namespace.c:4041 [inline]
       __do_sys_mount fs/namespace.c:4229 [inline]
       __se_sys_mount fs/namespace.c:4206 [inline]
       __x64_sys_mount+0x293/0x310 fs/namespace.c:4206
       do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
       do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (sb_internal){.+.+}-{0:0}:
       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+0x126f/0x1c90 kernel/locking/lockdep.c:5237
       lock_acquire kernel/locking/lockdep.c:5868 [inline]
       lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5825
       percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline]
       percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline]
       __sb_start_write include/linux/fs.h:1916 [inline]
       sb_start_intwrite include/linux/fs.h:2099 [inline]
       ext4_evict_inode+0xe3e/0x18e0 fs/ext4/inode.c:215
       evict+0x3e6/0x920 fs/inode.c:810
       iput_final fs/inode.c:1914 [inline]
       iput.part.0+0x6a9/0xb00 fs/inode.c:1966
       iput+0x35/0x40 fs/inode.c:1929
       ext4_ext_migrate+0xc6f/0x1ee0 fs/ext4/migrate.c:588
       __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/0xfa0 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(sb_internal);
                               lock(&sbi->s_writepages_rwsem);
  rlock(sb_internal);

 *** DEADLOCK ***

3 locks held by syz.4.5384/26557:
 #0: ffff88805de42420 (sb_writers#4){.+.+}-{0:0}, at: __ext4_ioctl+0x3146/0x4410 fs/ext4/ioctl.c:1684
 #1: ffff888045cd0d70 (&sb->s_type->i_mutex_key#9){++++}-{4:4}, at: inode_lock include/linux/fs.h:980 [inline]
 #1: ffff888045cd0d70 (&sb->s_type->i_mutex_key#9){++++}-{4:4}, at: __ext4_ioctl+0x3170/0x4410 fs/ext4/ioctl.c:1693
 #2: ffff88807c0ccb98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_write fs/ext4/ext4.h:1808 [inline]
 #2: ffff88807c0ccb98 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_ext_migrate+0x39c/0x1ee0 fs/ext4/migrate.c:438

stack backtrace:
CPU: 0 UID: 0 PID: 26557 Comm: syz.4.5384 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 print_circular_bug+0x275/0x350 kernel/locking/lockdep.c:2043
 check_noncircular+0x14c/0x170 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+0x126f/0x1c90 kernel/locking/lockdep.c:5237
 lock_acquire kernel/locking/lockdep.c:5868 [inline]
 lock_acquire+0x179/0x350 kernel/locking/lockdep.c:5825
 percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline]
 percpu_down_read_freezable include/linux/percpu-rwsem.h:83 [inline]
 __sb_start_write include/linux/fs.h:1916 [inline]
 sb_start_intwrite include/linux/fs.h:2099 [inline]
 ext4_evict_inode+0xe3e/0x18e0 fs/ext4/inode.c:215
 evict+0x3e6/0x920 fs/inode.c:810
 iput_final fs/inode.c:1914 [inline]
 iput.part.0+0x6a9/0xb00 fs/inode.c:1966
 iput+0x35/0x40 fs/inode.c:1929
 ext4_ext_migrate+0xc6f/0x1ee0 fs/ext4/migrate.c:588
 __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/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc21398f749
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:00007fc2148be038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fc213be5fa0 RCX: 00007fc21398f749
RDX: 0000000000000000 RSI: 0000000000006609 RDI: 0000000000000004
RBP: 00007fc213a13f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fc213be6038 R14: 00007fc213be5fa0 R15: 00007ffc7410fa88
 </TASK>

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/26 09:41 upstream 30f09200cc4a 64219f15 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in evict
2025/11/26 09:41 upstream 30f09200cc4a 64219f15 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in evict
2025/11/22 22:59 upstream 2eba5e05d9bc 4fb8ef37 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in evict
* Struck through repros no longer work on HEAD.