================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:841 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xae6/0xcc0 fs/ext4/extents.c:956 Read of size 4 at addr ffff88804a34fe18 by task kworker/u8:1/13 CPU: 0 UID: 0 PID: 13 Comm: kworker/u8:1 Tainted: G W 6.17.0-rc1-syzkaller-00211-g90d970cade8e #0 PREEMPT_{RT,(full)} Tainted: [W]=WARN Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Workqueue: writeback wb_workfn (flush-7:5) Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 ext4_ext_binsearch fs/ext4/extents.c:841 [inline] ext4_find_extent+0xae6/0xcc0 fs/ext4/extents.c:956 ext4_ext_map_blocks+0x288/0x6ac0 fs/ext4/extents.c:4208 ext4_map_create_blocks fs/ext4/inode.c:609 [inline] ext4_map_blocks+0x860/0x1740 fs/ext4/inode.c:811 mpage_map_one_extent fs/ext4/inode.c:2374 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2468 [inline] ext4_do_writepages+0x1f73/0x4600 fs/ext4/inode.c:2931 ext4_writepages+0x205/0x350 fs/ext4/inode.c:3025 do_writepages+0x32b/0x550 mm/page-writeback.c:2634 __writeback_single_inode+0x145/0x1000 fs/fs-writeback.c:1680 writeback_sb_inodes+0x6b7/0xf60 fs/fs-writeback.c:1976 wb_writeback+0x43b/0xaf0 fs/fs-writeback.c:2156 wb_do_writeback fs/fs-writeback.c:2303 [inline] wb_workfn+0x40e/0xf00 fs/fs-writeback.c:2343 process_one_work kernel/workqueue.c:3236 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xb50 pfn:0x4a34f flags: 0x80000000000000(node=0|zone=1) raw: 0080000000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000000b50 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 6939, tgid 6936 (syz.0.140), ts 145647573625, free_ts 146040306776 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x2119/0x21b0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0xd1/0x380 mm/mempolicy.c:2416 folio_alloc_mpol_noprof+0x39/0xe0 mm/mempolicy.c:2435 shmem_alloc_folio mm/shmem.c:1908 [inline] shmem_alloc_and_add_folio mm/shmem.c:1947 [inline] shmem_get_folio_gfp+0x633/0x1a70 mm/shmem.c:2597 shmem_get_folio mm/shmem.c:2703 [inline] shmem_write_begin+0xef/0x2a0 mm/shmem.c:3353 generic_perform_write+0x29a/0x8c0 mm/filemap.c:4175 shmem_file_write_iter+0xfb/0x120 mm/shmem.c:3528 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x5d2/0xb40 fs/read_write.c:686 ksys_write+0x14b/0x260 fs/read_write.c:738 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 6939 tgid 6936 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] free_unref_folios+0xd66/0x1460 mm/page_alloc.c:2952 folios_put_refs+0x569/0x670 mm/swap.c:997 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x49e/0x14b0 mm/shmem.c:1157 shmem_truncate_range mm/shmem.c:1269 [inline] shmem_evict_inode+0x272/0xa70 mm/shmem.c:1397 evict+0x504/0x9c0 fs/inode.c:810 __dentry_kill+0x209/0x660 fs/dcache.c:669 dput+0x19f/0x2b0 fs/dcache.c:911 __fput+0x69d/0xa80 fs/file_table.c:476 fput_close_sync+0x119/0x200 fs/file_table.c:573 __do_sys_close fs/open.c:1587 [inline] __se_sys_close fs/open.c:1572 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1572 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88804a34fd00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804a34fd80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88804a34fe00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88804a34fe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88804a34ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================