================================================================== BUG: KASAN: use-after-free in ext4_htree_fill_tree+0x1066/0x10d0 fs/ext4/namei.c:1246 Read of size 1 at addr ffff88811e64d365 by task syz-executor/467 CPU: 0 PID: 467 Comm: syz-executor Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106 print_address_description+0x71/0x200 mm/kasan/report.c:316 print_report+0x4a/0x60 mm/kasan/report.c:420 kasan_report+0x122/0x150 mm/kasan/report.c:524 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:348 ext4_htree_fill_tree+0x1066/0x10d0 fs/ext4/namei.c:1246 ext4_dx_readdir fs/ext4/dir.c:608 [inline] ext4_readdir+0x2d8a/0x3c10 fs/ext4/dir.c:145 iterate_dir+0x271/0x610 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+0x15c/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:218 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:0x7f75fb5bfad3 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:00007ffe34fde518 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 000055558a15b4e0 RCX: 00007f75fb5bfad3 RDX: 0000000000008000 RSI: 000055558a15b4e0 RDI: 0000000000000005 RBP: 000055558a15b4b4 R08: 0000000000028b61 R09: 0000000000000000 R10: 00007f75fb77cca0 R11: 0000000000000293 R12: ffffffffffffffa8 R13: 0000000000000010 R14: 000055558a15b4b0 R15: 00007ffe34fe07d0 The buggy address belongs to the physical page: page:ffffea0004799340 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11e64d flags: 0x4000000000000000(zone=1) raw: 4000000000000000 0000000000000000 ffffffff04790101 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 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 176, tgid 176 (rm), ts 7516525514, free_ts 53824121417 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2643 prep_new_page+0x1c/0x110 mm/page_alloc.c:2650 get_page_from_freelist+0x2c7b/0x2cf0 mm/page_alloc.c:4554 __alloc_pages+0x1c3/0x450 mm/page_alloc.c:5868 alloc_slab_page+0x6e/0xf0 include/linux/gfp.h:-1 allocate_slab mm/slub.c:1967 [inline] new_slab+0x98/0x3d0 mm/slub.c:2020 ___slab_alloc+0x6bd/0xb20 mm/slub.c:3177 kmem_cache_alloc_bulk+0x16a/0x3c0 mm/slub.c:3884 mt_alloc_bulk lib/maple_tree.c:160 [inline] mas_alloc_nodes+0x423/0x850 lib/maple_tree.c:1304 mas_node_count_gfp lib/maple_tree.c:1364 [inline] mas_preallocate+0xdf5/0x1400 lib/maple_tree.c:5662 vma_expand+0x3b7/0xa10 mm/mmap.c:564 __mmap_region mm/mmap.c:2843 [inline] mmap_region+0xef5/0x2290 mm/mmap.c:3028 do_mmap+0x843/0xdc0 mm/mmap.c:1490 vm_mmap_pgoff+0x1f5/0x3f0 mm/util.c:525 ksys_mmap_pgoff+0x161/0x1d0 mm/mmap.c:1536 __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 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1551 [inline] free_pcp_prepare mm/page_alloc.c:1625 [inline] free_unref_page_prepare+0x742/0x750 mm/page_alloc.c:3589 free_unref_page+0x8f/0x530 mm/page_alloc.c:3687 free_the_page mm/page_alloc.c:836 [inline] __free_pages+0x67/0x100 mm/page_alloc.c:5957 __free_slab+0xca/0x1a0 mm/slub.c:2044 free_slab mm/slub.c:2059 [inline] discard_slab+0x29/0x40 mm/slub.c:2065 __slab_free+0x201/0x280 mm/slub.c:3625 do_slab_free mm/slub.c:3666 [inline] ___cache_free+0xbf/0xd0 mm/slub.c:3722 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0xc6/0x140 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x14a/0x170 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x24/0x80 mm/kasan/common.c:310 kasan_slab_alloc include/linux/kasan.h:202 [inline] slab_post_alloc_hook+0x4f/0x2d0 mm/slab.h:768 slab_alloc_node mm/slub.c:3382 [inline] __kmem_cache_alloc_node+0x192/0x2c0 mm/slub.c:3423 __do_kmalloc_node mm/slab_common.c:937 [inline] __kmalloc_node_track_caller+0xa0/0x1e0 mm/slab_common.c:958 kmalloc_reserve net/core/skbuff.c:449 [inline] __alloc_skb+0x236/0x4b0 net/core/skbuff.c:518 alloc_skb include/linux/skbuff.h:1290 [inline] mld_newpack+0x13a/0xa10 net/ipv6/mcast.c:1745 add_grhead+0x67/0x300 net/ipv6/mcast.c:1856 Memory state around the buggy address: ffff88811e64d200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811e64d280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88811e64d300: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88811e64d380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811e64d400: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop0): 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 loop0): 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 loop0): 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 loop0): 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 loop0): 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 loop0): 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 loop0): 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 (loop0): unmounting filesystem.