================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch_idx fs/ext4/extents.c:759 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0x794/0xe20 fs/ext4/extents.c:924 Read of size 4 at addr ffff8881426bc274 by task syz.6.898/3965 CPU: 1 PID: 3965 Comm: syz.6.898 Tainted: G W syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/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_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_ext_binsearch_idx fs/ext4/extents.c:759 [inline] ext4_find_extent+0x794/0xe20 fs/ext4/extents.c:924 ext4_ext_map_blocks+0x1db/0x6270 fs/ext4/extents.c:4166 ext4_map_blocks+0x97b/0x1b20 fs/ext4/inode.c:674 mpage_map_one_extent fs/ext4/inode.c:2421 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2474 [inline] ext4_writepages+0x11e7/0x2f90 fs/ext4/inode.c:2842 do_writepages+0x48a/0x6c0 mm/page-writeback.c:2388 filemap_fdatawrite_wbc+0x1f4/0x250 mm/filemap.c:409 __filemap_fdatawrite_range mm/filemap.c:442 [inline] file_write_and_wait_range+0x129/0x1e0 mm/filemap.c:819 ext4_sync_file+0x1a9/0xa10 fs/ext4/fsync.c:151 vfs_fsync_range+0x190/0x1a0 fs/sync.c:188 generic_write_sync include/linux/fs.h:3038 [inline] ext4_buffered_write_iter+0x5d0/0x670 fs/ext4/file.c:277 ext4_file_write_iter+0x18c/0x1550 fs/ext4/file.c:664 call_write_iter include/linux/fs.h:2212 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x802/0xf70 fs/read_write.c:594 ksys_write+0x140/0x240 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 RIP: 0033:0x7f87d86a8749 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f87d70ef038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f87d88ff090 RCX: 00007f87d86a8749 RDX: 00000000fffffed6 RSI: 0000200000001700 RDI: 0000000000000004 RBP: 00007f87d872cf91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f87d88ff128 R14: 00007f87d88ff090 R15: 00007ffc6d32aef8 The buggy address belongs to the page: page:ffffea000509af00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1426bc flags: 0x4000000000000000(zone=1) raw: 4000000000000000 dead000000000100 dead000000000122 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 0x500dc0(GFP_USER|__GFP_ZERO|__GFP_ACCOUNT), pid 2993, ts 155916341835, free_ts 156799273319 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: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] __pte_alloc_one include/asm-generic/pgalloc.h:63 [inline] pte_alloc_one+0x70/0x180 arch/x86/mm/pgtable.c:33 __pte_alloc+0x75/0x290 mm/memory.c:502 copy_pte_range mm/memory.c:1096 [inline] copy_pmd_range mm/memory.c:1231 [inline] copy_pud_range mm/memory.c:1268 [inline] copy_p4d_range mm/memory.c:1292 [inline] copy_page_range+0x2348/0x2890 mm/memory.c:1365 dup_mmap kernel/fork.c:660 [inline] dup_mm kernel/fork.c:1522 [inline] copy_mm+0xbe2/0x13a0 kernel/fork.c:1574 copy_process+0x115c/0x3210 kernel/fork.c:2348 kernel_clone+0x23f/0x940 kernel/fork.c:2737 __do_sys_clone kernel/fork.c:2863 [inline] __se_sys_clone kernel/fork.c:2847 [inline] __x64_sys_clone+0x176/0x1d0 kernel/fork.c:2847 x64_sys_call+0x41f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:57 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+0x134/0x9d0 mm/page_alloc.c:3671 release_pages+0xfda/0x1030 mm/swap.c:1014 free_pages_and_swap_cache+0x86/0xa0 mm/swap_state.c:320 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu mm/mmu_gather.c:247 [inline] tlb_finish_mmu+0x175/0x300 mm/mmu_gather.c:338 exit_mmap+0x40f/0x860 mm/mmap.c:3248 __mmput+0x93/0x320 kernel/fork.c:1180 mmput+0x50/0x150 kernel/fork.c:1203 exit_mm kernel/exit.c:554 [inline] do_exit+0x9d2/0x27a0 kernel/exit.c:876 do_group_exit+0x141/0x310 kernel/exit.c:1003 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+0x87/0xd0 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 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 Memory state around the buggy address: ffff8881426bc100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881426bc180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8881426bc200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881426bc280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881426bc300: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================