syzbot


possible deadlock in ext4_destroy_inline_data

Status: upstream: reported on 2025/11/01 09:40
Reported-by: syzbot+6cbb2a7651e9b7c7dea6@syzkaller.appspotmail.com
First crash: 14d, last: 17h14m
Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 possible deadlock in ext4_destroy_inline_data 4 5 5d10h 8d12h 0/3 upstream: reported on 2025/11/07 02:20
linux-6.1 possible deadlock in ext4_destroy_inline_data 4 2 4d03h 6d05h 0/3 upstream: reported on 2025/11/09 09:23
upstream possible deadlock in ext4_destroy_inline_data (2) ext4 4 56 9h35m 9d16h 0/29 upstream: reported on 2025/11/05 22:08
upstream possible deadlock in ext4_destroy_inline_data ext4 4 1 335d 331d 0/29 auto-obsoleted due to no activity on 2025/03/25 12:07

Sample crash report:
loop1: detected capacity change from 0 to 2048
EXT4-fs (loop1): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none.
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.1.265/6664 is trying to acquire lock:
ffff88805f91e4c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline]
ffff88805f91e4c8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_destroy_inline_data+0x28/0xe0 fs/ext4/inline.c:1884

but task is already holding lock:
ffff88807ba16bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_read fs/ext4/ext4.h:1767 [inline]
ffff88807ba16bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages+0x170/0x2f0 fs/ext4/inode.c:2806

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 (&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+0x2ddb/0x7c80 kernel/locking/lockdep.c:5137
       lock_acquire+0x197/0x410 kernel/locking/lockdep.c:5754
       down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573
       ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline]
       ext4_destroy_inline_data+0x28/0xe0 fs/ext4/inline.c:1884
       ext4_do_writepages+0x4c2/0x38d0 fs/ext4/inode.c:2604
       ext4_writepages+0x1a8/0x2f0 fs/ext4/inode.c:2807
       do_writepages+0x3a2/0x600 mm/page-writeback.c:2575
       filemap_fdatawrite_wbc+0x122/0x180 mm/filemap.c:390
       __filemap_fdatawrite_range mm/filemap.c:423 [inline]
       file_write_and_wait_range+0x171/0x240 mm/filemap.c:781
       generic_buffers_fsync_noflush+0x6f/0x160 fs/buffer.c:609
       ext4_fsync_nojournal fs/ext4/fsync.c:88 [inline]
       ext4_sync_file+0x454/0xc10 fs/ext4/fsync.c:151
       generic_write_sync include/linux/fs.h:2651 [inline]
       ext4_buffered_write_iter+0x2c0/0x350 fs/ext4/file.c:305
       ext4_file_write_iter+0x1d9/0x1870 fs/ext4/file.c:-1
       call_write_iter include/linux/fs.h:2018 [inline]
       new_sync_write fs/read_write.c:491 [inline]
       vfs_write+0x43b/0x940 fs/read_write.c:584
       ksys_pwrite64 fs/read_write.c:699 [inline]
       __do_sys_pwrite64 fs/read_write.c:709 [inline]
       __se_sys_pwrite64 fs/read_write.c:706 [inline]
       __x64_sys_pwrite64+0x195/0x220 fs/read_write.c:706
       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
       ----                    ----
  rlock(&sbi->s_writepages_rwsem);
                               lock(&ei->xattr_sem);
                               lock(&sbi->s_writepages_rwsem);
  lock(&ei->xattr_sem);

 *** DEADLOCK ***

2 locks held by syz.1.265/6664:
 #0: ffff88807ba14418 (sb_writers#4){.+.+}-{0:0}, at: vfs_write+0x20e/0x940 fs/read_write.c:580
 #1: ffff88807ba16bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_read fs/ext4/ext4.h:1767 [inline]
 #1: ffff88807ba16bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages+0x170/0x2f0 fs/ext4/inode.c:2806

stack backtrace:
CPU: 0 PID: 6664 Comm: syz.1.265 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
 down_write+0x97/0x1f0 kernel/locking/rwsem.c:1573
 ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline]
 ext4_destroy_inline_data+0x28/0xe0 fs/ext4/inline.c:1884
 ext4_do_writepages+0x4c2/0x38d0 fs/ext4/inode.c:2604
 ext4_writepages+0x1a8/0x2f0 fs/ext4/inode.c:2807
 do_writepages+0x3a2/0x600 mm/page-writeback.c:2575
 filemap_fdatawrite_wbc+0x122/0x180 mm/filemap.c:390
 __filemap_fdatawrite_range mm/filemap.c:423 [inline]
 file_write_and_wait_range+0x171/0x240 mm/filemap.c:781
 generic_buffers_fsync_noflush+0x6f/0x160 fs/buffer.c:609
 ext4_fsync_nojournal fs/ext4/fsync.c:88 [inline]
 ext4_sync_file+0x454/0xc10 fs/ext4/fsync.c:151
 generic_write_sync include/linux/fs.h:2651 [inline]
 ext4_buffered_write_iter+0x2c0/0x350 fs/ext4/file.c:305
 ext4_file_write_iter+0x1d9/0x1870 fs/ext4/file.c:-1
 call_write_iter include/linux/fs.h:2018 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x43b/0x940 fs/read_write.c:584
 ksys_pwrite64 fs/read_write.c:699 [inline]
 __do_sys_pwrite64 fs/read_write.c:709 [inline]
 __se_sys_pwrite64 fs/read_write.c:706 [inline]
 __x64_sys_pwrite64+0x195/0x220 fs/read_write.c:706
 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:0x7f762518f6c9
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:00007f7625f42038 EFLAGS: 00000246 ORIG_RAX: 0000000000000012
RAX: ffffffffffffffda RBX: 00007f76253e5fa0 RCX: 00007f762518f6c9
RDX: 000000000000fdef RSI: 0000200000000140 RDI: 0000000000000004
RBP: 00007f7625211f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000e7c R11: 0000000000000246 R12: 0000000000000000
R13: 00007f76253e6038 R14: 00007f76253e5fa0 R15: 00007ffff0af1808
 </TASK>

Crashes (9):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/11/14 21:24 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_destroy_inline_data
2025/11/12 15:51 linux-6.6.y 0a805b6ea8cd 07e030de .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in ext4_destroy_inline_data
2025/11/12 15:51 linux-6.6.y 0a805b6ea8cd 07e030de .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in ext4_destroy_inline_data
2025/11/12 05:32 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_destroy_inline_data
2025/11/12 05:26 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_destroy_inline_data
2025/11/11 10:04 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_destroy_inline_data
2025/11/11 10:04 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_destroy_inline_data
2025/11/01 09:41 linux-6.6.y e5bbb12db2c7 2c50b6a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in ext4_destroy_inline_data
2025/11/01 09:39 linux-6.6.y e5bbb12db2c7 2c50b6a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan possible deadlock in ext4_destroy_inline_data
* Struck through repros no longer work on HEAD.