syzbot


KASAN: use-after-free Read in ext4_inlinedir_to_tree

Status: upstream: reported C repro on 2026/01/25 06:15
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+6ff629dda3dd0ffdf059@syzkaller.appspotmail.com
First crash: 4d11h, last: 4d10h
Bug presence (2)
Date Name Commit Repro Result
2026/01/25 lts (merge base) 8368be8a5072 C [report] KASAN: use-after-free Read in ext4_inlinedir_to_tree
2026/01/25 upstream (ToT) d91a46d6805a C [report] KASAN: use-after-free Read in ext4_inlinedir_to_tree
Similar bugs (7)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in ext4_inlinedir_to_tree ext4 19 C done 6 26d 518d 0/29 upstream: reported C repro on 2024/08/28 22:55
android-5-10 KASAN: use-after-free Read in ext4_inlinedir_to_tree 19 C error 7 5d01h 655d 0/2 upstream: reported C repro on 2024/04/14 03:44
android-54 KASAN: slab-out-of-bounds Read in ext4_inlinedir_to_tree 17 C 1 290d 655d 0/2 upstream: reported C repro on 2024/04/14 03:10
upstream KMSAN: uninit-value in number (4) kernel 7 C 7189 1163d 1541d 0/29 closed as invalid on 2022/11/28 10:01
android-6-1 KASAN: slab-out-of-bounds Read in ext4_inlinedir_to_tree origin:upstream 17 C error 1 45d 655d 0/2 upstream: reported C repro on 2024/04/14 08:35
upstream KMSAN: uninit-value in ext4_inlinedir_to_tree ext4 7 C 267 594d 640d 27/29 fixed on 2024/08/14 03:44
upstream KMSAN: uninit-value in htree_dirblock_to_tree ext4 7 204 991d 1122d 22/29 fixed on 2023/07/01 16:05

Sample crash report:
EXT4-fs (loop2): mounted filesystem without journal. Opts: errors=remount-ro,. Quota mode: none.
EXT4-fs error (device loop2): ext4_validate_block_bitmap:438: comm syz.2.17: bg 0: block 465: padding at end of block bitmap is not set
EXT4-fs (loop2): Remounting filesystem read-only
==================================================================
BUG: KASAN: use-after-free in ext4_read_inline_data fs/ext4/inline.c:210 [inline]
BUG: KASAN: use-after-free in ext4_inlinedir_to_tree+0x508/0xfe0 fs/ext4/inline.c:1433
Read of size 52 at addr ffff88812a6e4b97 by task syz.2.17/369

CPU: 0 PID: 369 Comm: syz.2.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
 <TASK>
 __dump_stack+0x21/0x30 lib/dump_stack.c:88
 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106
 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:427 [inline]
 kasan_report+0xf1/0x140 mm/kasan/report.c:444
 check_region_inline mm/kasan/generic.c:-1 [inline]
 kasan_check_range+0x249/0x2a0 mm/kasan/generic.c:189
 memcpy+0x2d/0x70 mm/kasan/shadow.c:65
 ext4_read_inline_data fs/ext4/inline.c:210 [inline]
 ext4_inlinedir_to_tree+0x508/0xfe0 fs/ext4/inline.c:1433
 ext4_htree_fill_tree+0x508/0x1160 fs/ext4/namei.c:1211
 ext4_dx_readdir fs/ext4/dir.c:609 [inline]
 ext4_readdir+0x2cdb/0x3b20 fs/ext4/dir.c:145
 iterate_dir+0x260/0x600 fs/readdir.c:-1
 __do_sys_getdents fs/readdir.c:286 [inline]
 __se_sys_getdents+0xf2/0x250 fs/readdir.c:271
 __x64_sys_getdents+0x7b/0x90 fs/readdir.c:271
 x64_sys_call+0xb4/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:79
 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:0x7f2d7c2dccb9
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:00007ffe32011708 EFLAGS: 00000246 ORIG_RAX: 000000000000004e
RAX: ffffffffffffffda RBX: 00007f2d7c557fa0 RCX: 00007f2d7c2dccb9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005
RBP: 00007f2d7c34abf7 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f2d7c557fac R14: 00007f2d7c557fa0 R15: 00007f2d7c557fa0
 </TASK>

The buggy address belongs to the page:
page:ffffea0004a9b900 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x12a6e4
flags: 0x4000000000000000(zone=1)
raw: 4000000000000000 ffffea0004a9b988 ffff8881f713c580 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 0, migratetype Movable, gfp_mask 0x100cca(GFP_HIGHUSER_MOVABLE), pid 295, ts 27167099229, free_ts 27169630803
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2605
 prep_new_page+0x1c/0x110 mm/page_alloc.c:2611
 get_page_from_freelist+0x2d3a/0x2dc0 mm/page_alloc.c:4485
 __alloc_pages+0x1a2/0x460 mm/page_alloc.c:5808
 __alloc_pages_node include/linux/gfp.h:595 [inline]
 alloc_pages_node include/linux/gfp.h:609 [inline]
 alloc_pages include/linux/gfp.h:622 [inline]
 shmem_alloc_page mm/shmem.c:1591 [inline]
 shmem_alloc_and_acct_page+0x4a2/0x8d0 mm/shmem.c:1616
 shmem_getpage_gfp+0xfe5/0x2310 mm/shmem.c:1912
 shmem_getpage mm/shmem.c:156 [inline]
 shmem_write_begin+0xce/0x1b0 mm/shmem.c:2480
 generic_perform_write+0x2b7/0x690 mm/filemap.c:3870
 __generic_file_write_iter+0x268/0x480 mm/filemap.c:3998
 generic_file_write_iter+0xa9/0x1d0 mm/filemap.c:4030
 call_write_iter include/linux/fs.h:2212 [inline]
 new_sync_write fs/read_write.c:507 [inline]
 vfs_write+0x835/0xfd0 fs/read_write.c:594
 ksys_write+0x149/0x250 fs/read_write.c:647
 __do_sys_write fs/read_write.c:659 [inline]
 __se_sys_write fs/read_write.c:656 [inline]
 __x64_sys_write+0x7b/0x90 fs/read_write.c:656
 x64_sys_call+0x8ef/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2
 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
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:26 [inline]
 free_pages_prepare mm/page_alloc.c:1472 [inline]
 free_pcp_prepare mm/page_alloc.c:1544 [inline]
 free_unref_page_prepare+0x542/0x550 mm/page_alloc.c:3534
 free_unref_page_list+0x13a/0x9d0 mm/page_alloc.c:3671
 release_pages+0x1006/0x1060 mm/swap.c:1014
 __pagevec_release+0x71/0xe0 mm/swap.c:1034
 pagevec_release include/linux/pagevec.h:81 [inline]
 shmem_undo_range+0x595/0x1470 mm/shmem.c:969
 shmem_truncate_range mm/shmem.c:1068 [inline]
 shmem_evict_inode+0x21a/0xa10 mm/shmem.c:1150
 evict+0x4c9/0x8d0 fs/inode.c:650
 iput_final fs/inode.c:1779 [inline]
 iput+0x635/0x7c0 fs/inode.c:1805
 dentry_unlink_inode+0x32f/0x3e0 fs/dcache.c:380
 __dentry_kill+0x44f/0x650 fs/dcache.c:586
 dentry_kill+0xc0/0x2a0 fs/dcache.c:-1
 dput+0x47/0x90 fs/dcache.c:893
 do_renameat2+0x8f4/0xfd0 fs/namei.c:4995
 __do_sys_rename fs/namei.c:5039 [inline]
 __se_sys_rename fs/namei.c:5037 [inline]
 __x64_sys_rename+0x86/0x90 fs/namei.c:5037
 x64_sys_call+0x680/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:83
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80

Memory state around the buggy address:
 ffff88812a6e4a80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88812a6e4b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88812a6e4b80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                         ^
 ffff88812a6e4c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88812a6e4c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
EXT4-fs error (device loop2): ext4_inlinedir_to_tree:1471: inode #12: block 7: comm syz.2.17: path /0/file1/file0: bad entry in directory: rec_len % 4 != 0 - offset=35110, inode=3517778242, rec_len=35106, size=112 fake=0
EXT4-fs (loop2): Remounting filesystem read-only

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/01/25 06:41 android13-5.15-lts 00b50d06692d 40acda8a .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro #1 (corrupt fs)] [mounted in repro #2 (corrupt fs)] ci2-android-5-15 KASAN: use-after-free Read in ext4_inlinedir_to_tree
2026/01/25 07:09 android13-5.15-lts 00b50d06692d 40acda8a .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro #1 (corrupt fs)] [mounted in repro #2 (corrupt fs)] ci2-android-5-15 KASAN: slab-out-of-bounds Read in ext4_inlinedir_to_tree
2026/01/25 06:12 android13-5.15-lts 00b50d06692d 40acda8a .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro #1 (corrupt fs)] [mounted in repro #2 (corrupt fs)] ci2-android-5-15 KASAN: slab-out-of-bounds Read in ext4_inlinedir_to_tree
2026/01/25 05:46 android13-5.15-lts 00b50d06692d 40acda8a .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Read in ext4_inlinedir_to_tree
* Struck through repros no longer work on HEAD.