================================================================== BUG: KASAN: use-after-free in ext4_htree_fill_tree+0x1316/0x13e0 fs/ext4/namei.c:1220 Read of size 1 at addr ffff8881087b0a67 by task syz-executor331/291 CPU: 0 PID: 291 Comm: syz-executor331 Not tainted 5.10.221-syzkaller-01371-g1240968f7644 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 ext4_htree_fill_tree+0x1316/0x13e0 fs/ext4/namei.c:1220 ext4_dx_readdir fs/ext4/dir.c:598 [inline] ext4_readdir+0x2dde/0x37c0 fs/ext4/dir.c:142 iterate_dir+0x265/0x580 __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 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f60cbb293b3 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 42 47 fb 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 b8 ff ff ff f7 d8 RSP: 002b:00007ffd3286c8a8 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 0000555555f89730 RCX: 00007f60cbb293b3 RDX: 0000000000008000 RSI: 0000555555f89730 RDI: 0000000000000004 RBP: 0000555555f89704 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001000 R11: 0000000000000293 R12: ffffffffffffffb8 R13: 0000000000000010 R14: 0000555555f89700 R15: 00007ffd3286eb20 The buggy address belongs to the page: page:ffffea000421ec00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1087b0 flags: 0x4000000000000000() raw: 4000000000000000 ffffea000421ec48 ffffea000420eec8 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 305, ts 24610674035, free_ts 24713924704 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5348 __alloc_pages include/linux/gfp.h:544 [inline] __alloc_pages_node include/linux/gfp.h:557 [inline] alloc_pages_node include/linux/gfp.h:571 [inline] alloc_pages include/linux/gfp.h:590 [inline] __page_cache_alloc include/linux/pagemap.h:290 [inline] page_cache_ra_unbounded+0x363/0x890 mm/readahead.c:226 do_page_cache_ra mm/readahead.c:277 [inline] force_page_cache_ra+0x373/0x3e0 mm/readahead.c:308 page_cache_sync_ra+0x254/0x2c0 mm/readahead.c:582 page_cache_sync_readahead include/linux/pagemap.h:837 [inline] generic_file_buffered_read+0x6da/0x2ad0 mm/filemap.c:2250 generic_file_read_iter+0x107/0x6b0 mm/filemap.c:2568 blkdev_read_iter+0x135/0x190 fs/block_dev.c:1956 call_read_iter include/linux/fs.h:2015 [inline] new_sync_read fs/read_write.c:415 [inline] vfs_read+0x999/0xbb0 fs/read_write.c:496 ksys_read+0x199/0x2c0 fs/read_write.c:634 __do_sys_read fs/read_write.c:644 [inline] __se_sys_read fs/read_write.c:642 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:642 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] free_pcp_prepare mm/page_alloc.c:1421 [inline] free_unref_page_prepare+0x2ae/0x2d0 mm/page_alloc.c:3336 free_unref_page_list+0x122/0xb20 mm/page_alloc.c:3443 release_pages+0xea0/0xef0 mm/swap.c:1103 __pagevec_release+0x84/0x100 mm/swap.c:1123 pagevec_release include/linux/pagevec.h:88 [inline] truncate_inode_pages_range+0xa81/0x1ae0 mm/truncate.c:367 truncate_inode_pages+0x24/0x30 mm/truncate.c:473 kill_bdev fs/block_dev.c:86 [inline] set_blocksize+0x354/0x3c0 fs/block_dev.c:171 sb_set_blocksize fs/block_dev.c:180 [inline] sb_min_blocksize+0xef/0x1b0 fs/block_dev.c:196 ext4_fill_super+0x740/0x9150 fs/ext4/super.c:4060 mount_bdev+0x262/0x370 fs/super.c:1429 ext4_mount+0x34/0x40 fs/ext4/super.c:6638 legacy_get_tree+0xf1/0x190 fs/fs_context.c:593 vfs_get_tree+0x88/0x290 fs/super.c:1559 do_new_mount+0x2ba/0xb30 fs/namespace.c:2910 path_mount+0x56f/0xcb0 fs/namespace.c:3240 do_mount fs/namespace.c:3253 [inline] __do_sys_mount fs/namespace.c:3461 [inline] __se_sys_mount+0x2c4/0x3b0 fs/namespace.c:3438 Memory state around the buggy address: ffff8881087b0900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881087b0980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8881087b0a00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881087b0a80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881087b0b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================