================================================================== BUG: KASAN: use-after-free in ext4_htree_fill_tree+0x131b/0x13e0 fs/ext4/namei.c:1246 Read of size 1 at addr ffff88812ddb2365 by task syz-executor/1260 CPU: 0 PID: 1260 Comm: syz-executor Not tainted 5.15.178-syzkaller-00193-g058abb720bd1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106 print_address_description+0x87/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:444 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 ext4_htree_fill_tree+0x131b/0x13e0 fs/ext4/namei.c:1246 ext4_dx_readdir fs/ext4/dir.c:606 [inline] ext4_readdir+0x2f75/0x3960 fs/ext4/dir.c:142 iterate_dir+0x265/0x600 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0x1c1/0x460 fs/readdir.c:354 __x64_sys_getdents64+0x7b/0x90 fs/readdir.c:354 x64_sys_call+0x5ae/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:218 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fcdff2be753 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 52 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:00007ffee3024978 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00005555760344e0 RCX: 00007fcdff2be753 RDX: 0000000000008000 RSI: 00005555760344e0 RDI: 0000000000000005 RBP: 00005555760344b4 R08: 0000000000028b61 R09: 0000000000000000 R10: 00007fcdff47bca0 R11: 0000000000000293 R12: ffffffffffffffa8 R13: 0000000000000010 R14: 00005555760344b0 R15: 00007ffee3026c30 </TASK> The buggy address belongs to the page: page:ffffea0004b76c80 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12ddb2 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea000444af08 ffffea000471a988 0000000000000000 raw: 0000000000000000 00000000000c0000 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 0x192800(GFP_NOWAIT|__GFP_NOWARN|__GFP_NORETRY|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 1057, ts 381430512509, free_ts 389240837275 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1b/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5780 allocate_slab mm/slub.c:1932 [inline] new_slab+0x9a/0x4e0 mm/slub.c:1995 ___slab_alloc+0x39e/0x830 mm/slub.c:3028 __slab_alloc+0x4a/0x90 mm/slub.c:3115 slab_alloc_node mm/slub.c:3206 [inline] slab_alloc mm/slub.c:3250 [inline] kmem_cache_alloc+0x139/0x250 mm/slub.c:3255 mempool_alloc_slab+0x1d/0x30 mm/mempool.c:513 mempool_alloc+0x149/0x550 mm/mempool.c:393 bio_alloc_bioset+0x12a/0x950 block/bio.c:469 bio_alloc include/linux/bio.h:429 [inline] submit_bh_wbc+0x1d1/0x6c0 fs/buffer.c:3028 submit_bh fs/buffer.c:3062 [inline] __sync_dirty_buffer+0x231/0x340 fs/buffer.c:3157 ext4_commit_super+0x370/0x470 fs/ext4/super.c:5512 ext4_handle_error+0x515/0x770 fs/ext4/super.c:658 __ext4_error_file+0x28c/0x590 fs/ext4/super.c:825 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+0x7c8/0x7d0 mm/page_alloc.c:3534 free_unref_page+0xe8/0x750 mm/page_alloc.c:3616 free_the_page mm/page_alloc.c:805 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5856 __free_slab+0xec/0x1d0 mm/slub.c:2020 free_slab mm/slub.c:2035 [inline] discard_slab mm/slub.c:2041 [inline] __unfreeze_partials+0x165/0x1a0 mm/slub.c:2527 put_cpu_partial+0xc4/0x120 mm/slub.c:2607 __slab_free+0x1c8/0x290 mm/slub.c:3390 do_slab_free mm/slub.c:3509 [inline] ___cache_free+0x109/0x120 mm/slub.c:3530 qlink_free+0x4d/0x90 mm/kasan/quarantine.c:157 qlist_free_all+0x44/0xb0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x15a/0x180 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:443 kasan_slab_alloc include/linux/kasan.h:217 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:550 slab_alloc_node mm/slub.c:3240 [inline] slab_alloc mm/slub.c:3250 [inline] kmem_cache_alloc+0xf5/0x250 mm/slub.c:3255 kmem_cache_alloc_node include/linux/slab.h:474 [inline] __alloc_skb+0xbe/0x550 net/core/skbuff.c:416 alloc_skb include/linux/skbuff.h:1183 [inline] alloc_skb_with_frags+0xa6/0x680 net/core/skbuff.c:6194 Memory state around the buggy address: ffff88812ddb2200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88812ddb2280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88812ddb2300: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88812ddb2380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88812ddb2400: 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