================================================================== BUG: KASAN: use-after-free in ext4_htree_fill_tree+0x106b/0x10d0 fs/ext4/namei.c:1246 Read of size 1 at addr ffff88811f9d5365 by task syz-executor/865 CPU: 1 PID: 865 Comm: syz-executor Not tainted 5.15.185-syzkaller-1080583-ge678c93d43cc #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 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 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 ext4_htree_fill_tree+0x106b/0x10d0 fs/ext4/namei.c:1246 ext4_dx_readdir fs/ext4/dir.c:609 [inline] ext4_readdir+0x2bfd/0x3a40 fs/ext4/dir.c:145 iterate_dir+0x260/0x600 fs/readdir.c:-1 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0xe5/0x240 fs/readdir.c:354 __x64_sys_getdents64+0x7b/0x90 fs/readdir.c:354 x64_sys_call+0x592/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:218 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:0x7f7ea5326ad3 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 72 3e f8 ff 66 90 b8 ff ff ff 7f 48 39 c2 48 0f 47 d0 b8 d9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 c7 c2 a8 ff ff ff f7 d8 RSP: 002b:00007ffe10987d68 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 000055555c4b54e0 RCX: 00007f7ea5326ad3 RDX: 0000000000008000 RSI: 000055555c4b54e0 RDI: 0000000000000005 RBP: 000055555c4b54b4 R08: 0000000000028b61 R09: 0000000000000000 R10: 00007f7ea54e3ca0 R11: 0000000000000293 R12: ffffffffffffffa8 R13: 0000000000000010 R14: 000055555c4b54b0 R15: 00007ffe1098a020 The buggy address belongs to the page: page:ffffea00047e7540 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11f9d5 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea00047e3808 ffffea00047db108 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 422, ts 51422361713, free_ts 52036742009 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+0x2cc5/0x2d50 mm/page_alloc.c:4485 __alloc_pages+0x18f/0x440 mm/page_alloc.c:5789 vm_area_alloc_pages mm/vmalloc.c:-1 [inline] __vmalloc_area_node mm/vmalloc.c:2956 [inline] __vmalloc_node_range+0x440/0x840 mm/vmalloc.c:3087 vmalloc_user+0x73/0x80 mm/vmalloc.c:3238 kcov_mmap+0x2b/0x130 kernel/kcov.c:474 call_mmap include/linux/fs.h:2209 [inline] mmap_file+0x60/0xb0 mm/util.c:1102 __mmap_region mm/mmap.c:1796 [inline] mmap_region+0xf94/0x1800 mm/mmap.c:2947 do_mmap+0x76c/0xe40 mm/mmap.c:1586 vm_mmap_pgoff+0x1ce/0x410 mm/util.c:555 ksys_mmap_pgoff+0x161/0x1d0 mm/mmap.c:1635 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:93 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __x64_sys_mmap+0xfa/0x110 arch/x86/kernel/sys_x86_64.c:86 x64_sys_call+0x83/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:10 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+0xa2/0x550 mm/page_alloc.c:3616 free_the_page mm/page_alloc.c:805 [inline] __free_pages+0x6c/0x100 mm/page_alloc.c:5865 __vunmap+0x84d/0x9e0 mm/vmalloc.c:2652 __vfree mm/vmalloc.c:2701 [inline] vfree+0x8b/0xc0 mm/vmalloc.c:2732 kcov_put kernel/kcov.c:417 [inline] kcov_close+0x2b/0x50 kernel/kcov.c:519 __fput+0x20b/0x8b0 fs/file_table.c:311 ____fput+0x15/0x20 fs/file_table.c:339 task_work_run+0x127/0x190 kernel/task_work.c:188 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0xa76/0x27a0 kernel/exit.c:880 do_group_exit+0x141/0x310 kernel/exit.c:1002 get_signal+0x66a/0x1480 kernel/signal.c:2907 arch_do_signal_or_restart+0xc1/0x10f0 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:154 [inline] exit_to_user_mode_loop+0xa7/0xe0 kernel/entry/common.c:178 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x1a/0x30 kernel/entry/common.c:307 Memory state around the buggy address: ffff88811f9d5200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811f9d5280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88811f9d5300: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88811f9d5380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811f9d5400: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop1): htree_dirblock_to_tree:1112: inode #2: block 20: comm syz-executor: bad entry in directory: inode out of bounds - offset=1024, inode=2033530174, rec_len=1012, size=1024 fake=0 EXT4-fs error (device loop1): htree_dirblock_to_tree:1112: inode #2: block 20: comm syz-executor: bad entry in directory: inode out of bounds - offset=1024, inode=2033530174, rec_len=1012, size=1024 fake=0 EXT4-fs error (device loop1): htree_dirblock_to_tree:1112: inode #2: block 20: comm syz-executor: bad entry in directory: inode out of bounds - offset=1024, inode=2033530174, rec_len=1012, size=1024 fake=0 EXT4-fs error (device loop1): htree_dirblock_to_tree:1112: inode #2: block 20: comm syz-executor: bad entry in directory: inode out of bounds - offset=1024, inode=2033530174, rec_len=1012, size=1024 fake=0 EXT4-fs error (device loop1): htree_dirblock_to_tree:1112: inode #2: block 20: comm syz-executor: bad entry in directory: inode out of bounds - offset=1024, inode=2033530174, rec_len=1012, size=1024 fake=0 EXT4-fs error (device loop1): htree_dirblock_to_tree:1112: inode #2: block 20: comm syz-executor: bad entry in directory: inode out of bounds - offset=1024, inode=2033530174, rec_len=1012, size=1024 fake=0 EXT4-fs error (device loop1): htree_dirblock_to_tree:1112: inode #2: block 20: comm syz-executor: bad entry in directory: inode out of bounds - offset=1024, inode=2033530174, rec_len=1012, size=1024 fake=0