syzbot


possible deadlock in ext4_evict_inode

Status: upstream: reported on 2025/11/07 03:25
Reported-by: syzbot+5135ee32614ae9e41ee0@syzkaller.appspotmail.com
First crash: 15d, last: 10d
Similar bugs (10)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in ext4_evict_inode (2) ext4 4 18 982d 1158d 0/29 auto-obsoleted due to no activity on 2023/07/14 13:24
linux-6.1 possible deadlock in ext4_evict_inode (3) 4 1 598d 598d 0/3 auto-obsoleted due to no activity on 2024/07/12 10:45
upstream possible deadlock in ext4_evict_inode (4) ext4 4 3 138d 138d 0/29 auto-obsoleted due to no activity on 2025/10/15 00:50
upstream possible deadlock in ext4_evict_inode (5) ext4 4 17 1h09m 17d 0/29 upstream: reported on 2025/11/05 11:40
linux-5.15 possible deadlock in ext4_evict_inode (2) 4 2 620d 625d 0/3 auto-obsoleted due to no activity on 2024/06/20 13:51
upstream possible deadlock in ext4_evict_inode (3) ext4 4 5 452d 645d 0/29 auto-obsoleted due to no activity on 2024/12/05 07:55
upstream possible deadlock in ext4_evict_inode ext4 4 syz error error 38 2595d 2634d 15/29 fixed on 2020/05/22 17:31
linux-6.1 possible deadlock in ext4_evict_inode 4 2 865d 974d 0/3 auto-obsoleted due to no activity on 2023/10/19 10:40
linux-6.1 possible deadlock in ext4_evict_inode (2) 4 1 717d 717d 0/3 auto-obsoleted due to no activity on 2024/03/15 02:58
linux-5.15 possible deadlock in ext4_evict_inode 4 2 966d 970d 0/3 auto-obsoleted due to no activity on 2023/07/30 00:10

Sample crash report:
ext4 filesystem being mounted at /116/file0aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa supports timestamps until 2038-01-19 (0x7fffffff)
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.0.484/7826 is trying to acquire lock:
ffff888023f88608 (sb_internal){.+.+}-{0:0}, at: __sb_start_write include/linux/fs.h:1633 [inline]
ffff888023f88608 (sb_internal){.+.+}-{0:0}, at: sb_start_intwrite include/linux/fs.h:1755 [inline]
ffff888023f88608 (sb_internal){.+.+}-{0:0}, at: ext4_evict_inode+0x2b9/0xea0 fs/ext4/inode.c:213

but task is already holding lock:
ffff888023f8abd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_write fs/ext4/ext4.h:1779 [inline]
ffff888023f8abd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_ext_migrate+0x2f1/0xff0 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+0x170/0x2f0 fs/ext4/inode.c:2806
       do_writepages+0x3a2/0x600 mm/page-writeback.c:2575
       __writeback_single_inode+0x153/0xee0 fs/fs-writeback.c:1635
       writeback_single_inode+0x211/0x720 fs/fs-writeback.c:1756
       write_inode_now+0x161/0x1e0 fs/fs-writeback.c:2802
       iput_final fs/inode.c:1807 [inline]
       iput+0x5b2/0x920 fs/inode.c:1846
       ext4_xattr_block_set+0x273a/0x32a0 fs/ext4/xattr.c:2211
       ext4_xattr_move_to_block fs/ext4/xattr.c:2679 [inline]
       ext4_xattr_make_inode_space fs/ext4/xattr.c:2754 [inline]
       ext4_expand_extra_isize_ea+0x10ea/0x19e0 fs/ext4/xattr.c:2846
       __ext4_expand_extra_isize+0x306/0x400 fs/ext4/inode.c:5967
       ext4_try_to_expand_extra_isize fs/ext4/inode.c:6010 [inline]
       __ext4_mark_inode_dirty+0x45d/0x6e0 fs/ext4/inode.c:6088
       ext4_evict_inode+0x7ed/0xea0 fs/ext4/inode.c:252
       evict+0x486/0x870 fs/inode.c:705
       ext4_orphan_cleanup+0xbd4/0x1400 fs/ext4/orphan.c:470
       __ext4_fill_super fs/ext4/super.c:5601 [inline]
       ext4_fill_super+0x5de4/0x66c0 fs/ext4/super.c:5724
       get_tree_bdev+0x3e4/0x510 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+0x2da/0x3c0 fs/namespace.c:3912
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

-> #0 (sb_internal){.+.+}-{0:0}:
       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+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
       lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
       percpu_down_read+0x44/0x1a0 include/linux/percpu-rwsem.h:51
       __sb_start_write include/linux/fs.h:1633 [inline]
       sb_start_intwrite include/linux/fs.h:1755 [inline]
       ext4_evict_inode+0x2b9/0xea0 fs/ext4/inode.c:213
       evict+0x486/0x870 fs/inode.c:705
       ext4_ext_migrate+0xcfb/0xff0 fs/ext4/migrate.c:587
       __ext4_ioctl fs/ext4/ioctl.c:1409 [inline]
       ext4_ioctl+0x1c4b/0x3820 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:51 [inline]
       do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
       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(sb_internal);
                               lock(&sbi->s_writepages_rwsem);
  rlock(sb_internal);

 *** DEADLOCK ***

3 locks held by syz.0.484/7826:
 #0: ffff888023f88418 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write_file+0x63/0x200 fs/namespace.c:456
 #1: ffff888077513610 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:804 [inline]
 #1: ffff888077513610 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: __ext4_ioctl fs/ext4/ioctl.c:1408 [inline]
 #1: ffff888077513610 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_ioctl+0x1c43/0x3820 fs/ext4/ioctl.c:1627
 #2: ffff888023f8abd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_write fs/ext4/ext4.h:1779 [inline]
 #2: ffff888023f8abd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_ext_migrate+0x2f1/0xff0 fs/ext4/migrate.c:437

stack backtrace:
CPU: 0 PID: 7826 Comm: syz.0.484 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
 check_noncircular+0x2bd/0x3c0 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+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
 lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
 percpu_down_read+0x44/0x1a0 include/linux/percpu-rwsem.h:51
 __sb_start_write include/linux/fs.h:1633 [inline]
 sb_start_intwrite include/linux/fs.h:1755 [inline]
 ext4_evict_inode+0x2b9/0xea0 fs/ext4/inode.c:213
 evict+0x486/0x870 fs/inode.c:705
 ext4_ext_migrate+0xcfb/0xff0 fs/ext4/migrate.c:587
 __ext4_ioctl fs/ext4/ioctl.c:1409 [inline]
 ext4_ioctl+0x1c4b/0x3820 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:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fd75eb8f6c9
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:00007fd75fa48038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fd75ede5fa0 RCX: 00007fd75eb8f6c9
RDX: 0000000000000000 RSI: 0000000000006609 RDI: 0000000000000004
RBP: 00007fd75ec11f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd75ede6038 R14: 00007fd75ede5fa0 R15: 00007ffc8130e5d8
 </TASK>

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/12 09:13 linux-6.6.y 0a805b6ea8cd 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in ext4_evict_inode
2025/11/07 03:25 linux-6.6.y 0a805b6ea8cd 4e1406b4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in ext4_evict_inode
* Struck through repros no longer work on HEAD.