================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:827 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xbab/0xdb0 fs/ext4/extents.c:946 Read of size 4 at addr ffff88811cb98810 by task kworker/u4:0/8 CPU: 0 PID: 8 Comm: kworker/u4:0 Not tainted 5.15.106-syzkaller-00249-g19c0ed55a470 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Workqueue: writeback wb_workfn (flush-7:0) Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 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_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_ext_binsearch fs/ext4/extents.c:827 [inline] ext4_find_extent+0xbab/0xdb0 fs/ext4/extents.c:946 ext4_ext_map_blocks+0x254/0x7250 fs/ext4/extents.c:4103 ext4_map_blocks+0xaa7/0x1e30 fs/ext4/inode.c:646 mpage_map_one_extent fs/ext4/inode.c:2419 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2472 [inline] ext4_writepages+0x162a/0x4010 fs/ext4/inode.c:2840 do_writepages+0x40e/0x670 mm/page-writeback.c:2366 __writeback_single_inode+0xdf/0xa70 fs/fs-writeback.c:1622 writeback_sb_inodes+0xb2e/0x1910 fs/fs-writeback.c:1905 wb_writeback+0x3b9/0x9e0 fs/fs-writeback.c:2079 wb_do_writeback fs/fs-writeback.c:2222 [inline] wb_workfn+0x3d9/0x1110 fs/fs-writeback.c:2263 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2313 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2460 kthread+0x421/0x510 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 The buggy address belongs to the page: page:ffffea000472e600 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x11cb98 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea000472e5c8 ffffea00046cc0c8 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 0x100cca(GFP_HIGHUSER_MOVABLE), pid 292, ts 19448167471, free_ts 19448753248 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2502 prep_new_page mm/page_alloc.c:2508 [inline] get_page_from_freelist+0x2c14/0x2cf0 mm/page_alloc.c:4291 __alloc_pages+0x386/0x7b0 mm/page_alloc.c:5569 __alloc_pages_node include/linux/gfp.h:591 [inline] alloc_pages_node include/linux/gfp.h:605 [inline] alloc_pages include/linux/gfp.h:618 [inline] wp_page_copy+0x201/0x1950 mm/memory.c:3176 do_wp_page+0x6fa/0xb60 handle_pte_fault+0x72e/0x2340 mm/memory.c:4832 do_handle_mm_fault+0x1fed/0x2330 mm/memory.c:5214 handle_mm_fault include/linux/mm.h:1836 [inline] do_user_addr_fault arch/x86/mm/fault.c:1458 [inline] handle_page_fault arch/x86/mm/fault.c:1549 [inline] exc_page_fault+0x3b5/0x830 arch/x86/mm/fault.c:1605 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:568 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1370 [inline] free_pcp_prepare mm/page_alloc.c:1442 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3441 free_unref_page_list+0x15d/0x980 mm/page_alloc.c:3562 release_pages+0x1310/0x1370 mm/swap.c:1009 free_pages_and_swap_cache+0x8a/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+0x177/0x320 mm/mmu_gather.c:338 exit_mmap+0x3ef/0x6f0 mm/mmap.c:3211 __mmput+0x95/0x310 kernel/fork.c:1171 mmput+0x5b/0x170 kernel/fork.c:1194 exit_mm kernel/exit.c:551 [inline] do_exit+0xbb4/0x2b60 kernel/exit.c:862 do_group_exit+0x141/0x310 kernel/exit.c:997 __do_sys_exit_group kernel/exit.c:1008 [inline] __se_sys_exit_group kernel/exit.c:1006 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1006 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff88811cb98700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811cb98780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88811cb98800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88811cb98880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811cb98900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop0): ext4_map_blocks:726: inode #16: block 37379922547201: comm kworker/u4:0: lblock 0 mapped to illegal pblock 37379922547201 (length 1) EXT4-fs (loop0): Delayed block allocation failed for inode 16 at logical offset 0 with max blocks 1 with error 117 EXT4-fs (loop0): This should not happen!! Data will be lost EXT4-fs error (device loop0): ext4_map_blocks:726: inode #16: block 2: comm kworker/u4:0: lblock 2 mapped to illegal pblock 2 (length 1) EXT4-fs (loop0): Delayed block allocation failed for inode 16 at logical offset 2 with max blocks 1 with error 117 EXT4-fs (loop0): This should not happen!! Data will be lost