================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:827 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xbc4/0xdd0 fs/ext4/extents.c:946 Read of size 4 at addr ffff88807f73cc44 by task kworker/u4:3/155 CPU: 1 PID: 155 Comm: kworker/u4:3 Not tainted 5.15.167-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: writeback wb_workfn (flush-7:0) Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 ext4_ext_binsearch fs/ext4/extents.c:827 [inline] ext4_find_extent+0xbc4/0xdd0 fs/ext4/extents.c:946 ext4_ext_map_blocks+0x2da/0x7630 fs/ext4/extents.c:4144 ext4_map_blocks+0xa66/0x1c70 fs/ext4/inode.c:672 mpage_map_one_extent fs/ext4/inode.c:2407 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2460 [inline] ext4_writepages+0x160e/0x3d10 fs/ext4/inode.c:2828 do_writepages+0x481/0x730 mm/page-writeback.c:2386 __writeback_single_inode+0x15b/0xe30 fs/fs-writeback.c:1647 writeback_sb_inodes+0xbce/0x1a40 fs/fs-writeback.c:1930 wb_writeback+0x451/0xc50 fs/fs-writeback.c:2104 wb_do_writeback fs/fs-writeback.c:2247 [inline] wb_workfn+0x46c/0x1130 fs/fs-writeback.c:2288 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 The buggy address belongs to the page: page:ffffea0001fdcf00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x7f73c flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001bd8f48 ffffea0001bd84c8 0000000000000000 raw: 0000000000000001 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 0x1100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), pid 4012, ts 66815997918, free_ts 66806815357 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423 alloc_pages_vma+0x39a/0x800 mm/mempolicy.c:2146 do_cow_fault mm/memory.c:4253 [inline] do_fault mm/memory.c:4364 [inline] handle_pte_fault mm/memory.c:4620 [inline] __handle_mm_fault mm/memory.c:4755 [inline] handle_mm_fault+0x2597/0x5960 mm/memory.c:4853 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page_list+0x1f7/0x8e0 mm/page_alloc.c:3433 release_pages+0x1bb9/0x1f40 mm/swap.c:963 __pagevec_lru_add+0x1584/0x18d0 mm/swap.c:1056 lru_cache_add+0x556/0x7e0 mm/swap.c:453 wp_page_copy+0xec3/0x2070 mm/memory.c:3087 handle_pte_fault mm/memory.c:4638 [inline] __handle_mm_fault mm/memory.c:4755 [inline] handle_mm_fault+0x2a3d/0x5960 mm/memory.c:4853 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 Memory state around the buggy address: ffff88807f73cb00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807f73cb80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88807f73cc00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88807f73cc80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807f73cd00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================