[v6.6] possible deadlock in ext4_destroy_inline_data

2 views
Skip to first unread message

syzbot

unread,
Nov 1, 2025, 5:40:27 AM (9 days ago) Nov 1
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: e5bbb12db2c7 Linux 6.6.115
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1532fe7c580000
kernel config: https://syzkaller.appspot.com/x/.config?x=12606d4b8832c7e4
dashboard link: https://syzkaller.appspot.com/bug?extid=6cbb2a7651e9b7c7dea6
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e6860876f0ec/disk-e5bbb12d.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d6c28d7cc7f3/vmlinux-e5bbb12d.xz
kernel image: https://storage.googleapis.com/syzbot-assets/8f52ba3964b2/bzImage-e5bbb12d.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+6cbb2a...@syzkaller.appspotmail.com

EXT4-fs (loop2): 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.2.1898/13434 is trying to acquire lock:
ffff888077f2bcc8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline]
ffff888077f2bcc8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_destroy_inline_data+0x28/0xe0 fs/ext4/inline.c:1884

but task is already holding lock:
ffff88802eb88bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_read fs/ext4/ext4.h:1767 [inline]
ffff88802eb88bd8 (&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.2.1898/13434:
#0: ffff88802493c418 (sb_writers#4){.+.+}-{0:0}, at: vfs_write+0x20e/0x940 fs/read_write.c:580
#1: ffff88802eb88bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages_down_read fs/ext4/ext4.h:1767 [inline]
#1: ffff88802eb88bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_writepages+0x170/0x2f0 fs/ext4/inode.c:2806

stack backtrace:
CPU: 1 PID: 13434 Comm: syz.2.1898 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:0x7f8c0e38efc9
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:00007f8c0f1fe038 EFLAGS: 00000246 ORIG_RAX: 0000000000000012
RAX: ffffffffffffffda RBX: 00007f8c0e5e5fa0 RCX: 00007f8c0e38efc9
RDX: 0000000000000001 RSI: 0000200000000000 RDI: 0000000000000004
RBP: 00007f8c0e411f91 R08: 0000000000000000 R09: 0000000000000000
R10: 000000000004fed0 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f8c0e5e6038 R14: 00007f8c0e5e5fa0 R15: 00007ffc0acfc8b8
</TASK>
EXT4-fs (loop2): Delayed block allocation failed for inode 15 at logical offset 159 with max blocks 1 with error 28
EXT4-fs (loop2): This should not happen!! Data will be lost

EXT4-fs (loop2): Total free blocks count 0
EXT4-fs (loop2): Free/Dirty block details
EXT4-fs (loop2): free_blocks=2415919104
EXT4-fs (loop2): dirty_blocks=32


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Nov 6, 2025, 9:20:28 PM (3 days ago) Nov 6
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: cc5ec8769306 Linux 5.15.196
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=161c4532580000
kernel config: https://syzkaller.appspot.com/x/.config?x=e1bb6d24ef2164eb
dashboard link: https://syzkaller.appspot.com/bug?extid=77dc833fe5577a238762
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c71c660545b2/disk-cc5ec876.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/4f011826cca6/vmlinux-cc5ec876.xz
kernel image: https://storage.googleapis.com/syzbot-assets/8ccd1a2c3f8c/bzImage-cc5ec876.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+77dc83...@syzkaller.appspotmail.com

loop2: detected capacity change from 0 to 2048
EXT4-fs (loop2): mounted filesystem without journal. Opts: ,errors=continue. Quota mode: none.
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.2.124/4819 is trying to acquire lock:
ffff88805f958ac0 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline]
ffff88805f958ac0 (&ei->xattr_sem){++++}-{3:3}, at: ext4_destroy_inline_data+0x24/0xe0 fs/ext4/inline.c:1890

but task is already holding lock:
ffff8880229f6bd8 (&sbi->s_writepages_rwsem){.+.+}-{0:0}, at: ext4_writepages+0x1c0/0x2d20 fs/ext4/inode.c:2689

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+0x1c0/0x2d20 fs/ext4/inode.c:2689
do_writepages+0x48d/0x6d0 mm/page-writeback.c:2386
__writeback_single_inode+0x153/0xda0 fs/fs-writeback.c:1657
writeback_single_inode+0x221/0x8b0 fs/fs-writeback.c:1770
write_inode_now+0x217/0x280 fs/fs-writeback.c:2811
iput_final fs/inode.c:1756 [inline]
iput+0x5ab/0x8a0 fs/inode.c:1795
ext4_xattr_set_entry+0x10ff/0x3d30 fs/ext4/xattr.c:1837
ext4_xattr_block_set+0x4f7/0x2d30 fs/ext4/xattr.c:1936
ext4_xattr_move_to_block fs/ext4/xattr.c:2633 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2708 [inline]
ext4_expand_extra_isize_ea+0xf4b/0x19a0 fs/ext4/xattr.c:2800
__ext4_expand_extra_isize+0x301/0x3e0 fs/ext4/inode.c:5901
ext4_try_to_expand_extra_isize fs/ext4/inode.c:5944 [inline]
__ext4_mark_inode_dirty+0x469/0x700 fs/ext4/inode.c:6022
ext4_evict_inode+0xa81/0x1080 fs/ext4/inode.c:282
evict+0x485/0x870 fs/inode.c:647
ext4_orphan_cleanup+0xaa9/0x12e0 fs/ext4/orphan.c:470
ext4_fill_super+0x92f0/0x9a60 fs/ext4/super.c:4975
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+0x2d6/0x3c0 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+0x2c33/0x7c60 kernel/locking/lockdep.c:5012
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline]
ext4_destroy_inline_data+0x24/0xe0 fs/ext4/inline.c:1890
ext4_writepages+0x5df/0x2d20 fs/ext4/inode.c:2735
do_writepages+0x48d/0x6d0 mm/page-writeback.c:2386
filemap_fdatawrite_wbc+0x1eb/0x240 mm/filemap.c:400
__filemap_fdatawrite_range mm/filemap.c:433 [inline]
__filemap_fdatawrite mm/filemap.c:439 [inline]
filemap_flush+0xb3/0x100 mm/filemap.c:466
ext4_convert_inline_data+0x17d/0x5d0 fs/ext4/inline.c:2066
ext4_fallocate+0xf4/0x1ee0 fs/ext4/extents.c:4759
vfs_fallocate+0x587/0x6f0 fs/open.c:308
ioctl_preallocate fs/ioctl.c:294 [inline]
file_ioctl fs/ioctl.c:-1 [inline]
do_vfs_ioctl+0x1b70/0x1de0 fs/ioctl.c:853
__do_sys_ioctl fs/ioctl.c:872 [inline]
__se_sys_ioctl+0x83/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.2.124/4819:
#0: ffff88807e280460 (sb_writers#5){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:3043 [inline]
#0: ffff88807e280460 (sb_writers#5){.+.+}-{0:0}, at: vfs_fallocate+0x4f4/0x6f0 fs/open.c:307
#1: ffff88805f958de8 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline]
#1: ffff88805f958de8 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: ext4_fallocate+0xec/0x1ee0 fs/ext4/extents.c:4758
#2: ffff8880229f6bd8 (&sbi->s_writepages_rwsem){.+.+}-{0:0}, at: ext4_writepages+0x1c0/0x2d20 fs/ext4/inode.c:2689

stack backtrace:
CPU: 0 PID: 4819 Comm: syz.2.124 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
<TASK>
dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
check_noncircular+0x274/0x310 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+0x2c33/0x7c60 kernel/locking/lockdep.c:5012
lock_acquire+0x197/0x3f0 kernel/locking/lockdep.c:5623
down_write+0x38/0x60 kernel/locking/rwsem.c:1551
ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline]
ext4_destroy_inline_data+0x24/0xe0 fs/ext4/inline.c:1890
ext4_writepages+0x5df/0x2d20 fs/ext4/inode.c:2735
do_writepages+0x48d/0x6d0 mm/page-writeback.c:2386
filemap_fdatawrite_wbc+0x1eb/0x240 mm/filemap.c:400
__filemap_fdatawrite_range mm/filemap.c:433 [inline]
__filemap_fdatawrite mm/filemap.c:439 [inline]
filemap_flush+0xb3/0x100 mm/filemap.c:466
ext4_convert_inline_data+0x17d/0x5d0 fs/ext4/inline.c:2066
ext4_fallocate+0xf4/0x1ee0 fs/ext4/extents.c:4759
vfs_fallocate+0x587/0x6f0 fs/open.c:308
ioctl_preallocate fs/ioctl.c:294 [inline]
file_ioctl fs/ioctl.c:-1 [inline]
do_vfs_ioctl+0x1b70/0x1de0 fs/ioctl.c:853
__do_sys_ioctl fs/ioctl.c:872 [inline]
__se_sys_ioctl+0x83/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:0x7fb58d4e56c9
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:00007fb58b74c038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fb58d73bfa0 RCX: 00007fb58d4e56c9
RDX: 0000200000000240 RSI: 0000000040305829 RDI: 0000000000000004
RBP: 00007fb58d567f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fb58d73c038 R14: 00007fb58d73bfa0 R15: 00007ffc5878bdc8
</TASK>
EXT4-fs error (device loop2): ext4_mb_generate_buddy:1147: group 0, block bitmap and bg descriptor inconsistent: 25 vs 281 free clusters
EXT4-fs (loop2): Delayed block allocation failed for inode 15 at logical offset 0 with max blocks 1 with error 28
EXT4-fs (loop2): This should not happen!! Data will be lost

EXT4-fs (loop2): Total free blocks count 0
EXT4-fs (loop2): Free/Dirty block details
EXT4-fs (loop2): free_blocks=4096
EXT4-fs (loop2): dirty_blocks=32
EXT4-fs (loop2): Block reservation details
EXT4-fs (loop2): i_reserved_data_blocks=2

syzbot

unread,
4:23 AM (12 hours ago) 4:23 AM
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: f6e38ae624cf Linux 6.1.158
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13816a92580000
kernel config: https://syzkaller.appspot.com/x/.config?x=7eb38bd5021fec61
dashboard link: https://syzkaller.appspot.com/bug?extid=ed8bb2474e55e323a784
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/2b7003e2661d/disk-f6e38ae6.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/0696cea8d016/vmlinux-f6e38ae6.xz
kernel image: https://storage.googleapis.com/syzbot-assets/6b7a89e636d7/bzImage-f6e38ae6.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+ed8bb2...@syzkaller.appspotmail.com

loop3: detected capacity change from 0 to 2048
EXT4-fs (loop3): mounted filesystem without journal. Quota mode: none.
EXT4-fs error (device loop3): ext4_xattr_ibody_get:603: inode #15: comm syz.3.392: corrupted in-inode xattr
EXT4-fs error (device loop3): get_max_inline_xattr_value_size:69: inode #15: comm syz.3.392: corrupt xattr in inline inode
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.3.392/5845 is trying to acquire lock:
ffff8880549694d8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline]
ffff8880549694d8 (&ei->xattr_sem){++++}-{3:3}, at: ext4_destroy_inline_data+0x24/0xe0 fs/ext4/inline.c:1912

but task is already holding lock:
ffff888056690b98 (&sbi->s_writepages_rwsem){.+.+}-{0:0}, at: ext4_writepages+0x1c0/0x2e50 fs/ext4/inode.c:2715

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+0x1c0/0x2e50 fs/ext4/inode.c:2715
do_writepages+0x3b7/0x610 mm/page-writeback.c:2491
__writeback_single_inode+0x156/0x1160 fs/fs-writeback.c:1622
writeback_single_inode+0x221/0x8b0 fs/fs-writeback.c:1743
write_inode_now+0x15d/0x1d0 fs/fs-writeback.c:2780
iput_final fs/inode.c:1821 [inline]
iput+0x613/0x980 fs/inode.c:1860
ext4_xattr_block_set+0x2736/0x32a0 fs/ext4/xattr.c:2158
ext4_xattr_move_to_block fs/ext4/xattr.c:2626 [inline]
ext4_xattr_make_inode_space fs/ext4/xattr.c:2701 [inline]
ext4_expand_extra_isize_ea+0x109b/0x19b0 fs/ext4/xattr.c:2793
__ext4_expand_extra_isize+0x301/0x3e0 fs/ext4/inode.c:5980
ext4_try_to_expand_extra_isize fs/ext4/inode.c:6023 [inline]
__ext4_mark_inode_dirty+0x47f/0x770 fs/ext4/inode.c:6101
ext4_evict_inode+0xa73/0x1100 fs/ext4/inode.c:279
evict+0x485/0x870 fs/inode.c:705
ext4_orphan_cleanup+0xbd3/0x1400 fs/ext4/orphan.c:470
__ext4_fill_super fs/ext4/super.c:5530 [inline]
ext4_fill_super+0x7bdf/0x8150 fs/ext4/super.c:5661
get_tree_bdev+0x3f1/0x610 fs/super.c:1366
vfs_get_tree+0x88/0x270 fs/super.c:1573
do_new_mount+0x24a/0xa40 fs/namespace.c:3078
do_mount fs/namespace.c:3421 [inline]
__do_sys_mount fs/namespace.c:3629 [inline]
__se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3606
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 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:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain kernel/locking/lockdep.c:3825 [inline]
__lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049
lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
down_write+0x36/0x60 kernel/locking/rwsem.c:1573
ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline]
ext4_destroy_inline_data+0x24/0xe0 fs/ext4/inline.c:1912
ext4_writepages+0x5df/0x2e50 fs/ext4/inode.c:2761
do_writepages+0x3b7/0x610 mm/page-writeback.c:2491
filemap_fdatawrite_wbc+0x11e/0x180 mm/filemap.c:388
__filemap_fdatawrite_range mm/filemap.c:421 [inline]
file_write_and_wait_range+0x137/0x200 mm/filemap.c:774
ext4_sync_file+0x23b/0xca0 fs/ext4/fsync.c:151
generic_write_sync include/linux/fs.h:2962 [inline]
ext4_buffered_write_iter+0x347/0x3e0 fs/ext4/file.c:292
ext4_file_write_iter+0x1d6/0x16e0 fs/ext4/file.c:-1
do_iter_readv_writev fs/read_write.c:-1 [inline]
do_iter_write+0x62d/0xaf0 fs/read_write.c:861
iter_file_splice_write+0x665/0xc50 fs/splice.c:685
do_splice_from fs/splice.c:763 [inline]
direct_splice_actor+0xe1/0x130 fs/splice.c:950
splice_direct_to_actor+0x480/0xb60 fs/splice.c:896
do_splice_direct+0x1b0/0x2b0 fs/splice.c:1002
generic_copy_file_range fs/read_write.c:1393 [inline]
vfs_copy_file_range+0xa7a/0x1560 fs/read_write.c:1539
__do_sys_copy_file_range fs/read_write.c:1596 [inline]
__se_sys_copy_file_range+0x31d/0x480 fs/read_write.c:1559
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 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(&ei->xattr_sem);
lock(&sbi->s_writepages_rwsem);
lock(&ei->xattr_sem);

*** DEADLOCK ***

2 locks held by syz.3.392/5845:
#0: ffff888056692460 (sb_writers#4){.+.+}-{0:0}, at: vfs_copy_file_range+0x8d3/0x1560 fs/read_write.c:1502
#1: ffff888056690b98 (&sbi->s_writepages_rwsem){.+.+}-{0:0}, at: ext4_writepages+0x1c0/0x2e50 fs/ext4/inode.c:2715

stack backtrace:
CPU: 0 PID: 5845 Comm: syz.3.392 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
Call Trace:
<TASK>
dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2170
check_prev_add kernel/locking/lockdep.c:3090 [inline]
check_prevs_add kernel/locking/lockdep.c:3209 [inline]
validate_chain kernel/locking/lockdep.c:3825 [inline]
__lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049
lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
down_write+0x36/0x60 kernel/locking/rwsem.c:1573
ext4_write_lock_xattr fs/ext4/xattr.h:155 [inline]
ext4_destroy_inline_data+0x24/0xe0 fs/ext4/inline.c:1912
ext4_writepages+0x5df/0x2e50 fs/ext4/inode.c:2761
do_writepages+0x3b7/0x610 mm/page-writeback.c:2491
filemap_fdatawrite_wbc+0x11e/0x180 mm/filemap.c:388
__filemap_fdatawrite_range mm/filemap.c:421 [inline]
file_write_and_wait_range+0x137/0x200 mm/filemap.c:774
ext4_sync_file+0x23b/0xca0 fs/ext4/fsync.c:151
generic_write_sync include/linux/fs.h:2962 [inline]
ext4_buffered_write_iter+0x347/0x3e0 fs/ext4/file.c:292
ext4_file_write_iter+0x1d6/0x16e0 fs/ext4/file.c:-1
do_iter_readv_writev fs/read_write.c:-1 [inline]
do_iter_write+0x62d/0xaf0 fs/read_write.c:861
iter_file_splice_write+0x665/0xc50 fs/splice.c:685
do_splice_from fs/splice.c:763 [inline]
direct_splice_actor+0xe1/0x130 fs/splice.c:950
splice_direct_to_actor+0x480/0xb60 fs/splice.c:896
do_splice_direct+0x1b0/0x2b0 fs/splice.c:1002
generic_copy_file_range fs/read_write.c:1393 [inline]
vfs_copy_file_range+0xa7a/0x1560 fs/read_write.c:1539
__do_sys_copy_file_range fs/read_write.c:1596 [inline]
__se_sys_copy_file_range+0x31d/0x480 fs/read_write.c:1559
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f0c2518f6c9
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:00007f0c25fd0038 EFLAGS: 00000246 ORIG_RAX: 0000000000000146
RAX: ffffffffffffffda RBX: 00007f0c253e5fa0 RCX: 00007f0c2518f6c9
RDX: 0000000000000006 RSI: 0000000000000000 RDI: 0000000000000006
RBP: 00007f0c25211f91 R08: 0000000000000863 R09: 0000000000000000
R10: 00002000000000c0 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f0c253e6038 R14: 00007f0c253e5fa0 R15: 00007ffeb0517f98
</TASK>
EXT4-fs error (device loop3): ext4_xattr_ibody_find:2196: inode #15: comm syz.3.392: corrupted in-inode xattr
syz.3.392: attempt to access beyond end of device
loop3: rw=2049, sector=7212754380, nr_sectors = 4 limit=2048
EXT4-fs warning (device loop3): ext4_end_bio:347: I/O error 10 writing to inode 15 starting block 1803188595)
Buffer I/O error on device loop3, logical block 1803188595
syz.3.392: attempt to access beyond end of device
loop3: rw=2049, sector=6806417796, nr_sectors = 4 limit=2048
EXT4-fs warning (device loop3): ext4_end_bio:347: I/O error 10 writing to inode 15 starting block 1701604449)
Buffer I/O error on device loop3, logical block 1701604449
Reply all
Reply to author
Forward
0 new messages