================================================================== 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 ffff8881209d2784 by task kworker/u4:4/396 CPU: 0 PID: 396 Comm: kworker/u4:4 Not tainted 5.15.167-syzkaller-1075712-g5e4635681cf1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: ext4-rsv-conversion ext4_end_io_rsv_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1c0 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+0x269/0x7450 fs/ext4/extents.c:4144 ext4_map_blocks+0xa60/0x1c70 fs/ext4/inode.c:673 ext4_convert_unwritten_extents+0x2e0/0x6c0 fs/ext4/extents.c:4846 ext4_convert_unwritten_io_end_vec+0x104/0x180 fs/ext4/extents.c:4885 ext4_end_io_end fs/ext4/page-io.c:186 [inline] ext4_do_flush_completed_IO fs/ext4/page-io.c:259 [inline] ext4_end_io_rsv_work+0x358/0x690 fs/ext4/page-io.c:273 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 The buggy address belongs to the page: page:ffffea0004827480 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x1209d2 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea0004827588 ffffea0004826bc8 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 295, ts 28950612065, free_ts 30016606322 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1b/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5779 __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+0x200/0x1b00 mm/memory.c:3194 do_wp_page+0x9ca/0xc90 handle_pte_fault+0x799/0x25c0 mm/memory.c:4897 do_handle_mm_fault+0x20bc/0x2400 mm/memory.c:5298 do_user_addr_fault arch/x86/mm/fault.c:1325 [inline] handle_page_fault arch/x86/mm/fault.c:1509 [inline] exc_page_fault+0x26f/0x7f0 arch/x86/mm/fault.c:1565 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:1472 [inline] free_pcp_prepare mm/page_alloc.c:1544 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3534 free_unref_page_list+0x14b/0xa60 mm/page_alloc.c:3671 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+0xd0/0x180 mm/mmu_gather.c:247 zap_pte_range mm/memory.c:1513 [inline] zap_pmd_range mm/memory.c:1562 [inline] zap_pud_range mm/memory.c:1591 [inline] zap_p4d_range mm/memory.c:1612 [inline] unmap_page_range+0x1c70/0x1ed0 mm/memory.c:1633 unmap_single_vma mm/memory.c:1678 [inline] unmap_vmas+0x389/0x560 mm/memory.c:1710 exit_mmap+0x3e4/0x940 mm/mmap.c:3215 __mmput+0x95/0x310 kernel/fork.c:1179 mmput+0x5b/0x170 kernel/fork.c:1202 exit_mm kernel/exit.c:554 [inline] do_exit+0xb9c/0x2ca0 kernel/exit.c:867 do_group_exit+0x141/0x310 kernel/exit.c:1002 get_signal+0x7a3/0x1630 kernel/signal.c:2904 arch_do_signal_or_restart+0xbd/0x1680 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:154 [inline] exit_to_user_mode_loop+0xa0/0xe0 kernel/entry/common.c:178 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:214 Memory state around the buggy address: ffff8881209d2680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881209d2700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8881209d2780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881209d2800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881209d2880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop2): ext4_map_blocks:739: inode #19: block 55834574885: comm kworker/u4:4: lblock 37 mapped to illegal pblock 55834574885 (length 1) EXT4-fs warning (device loop2): ext4_convert_unwritten_extents:4853: inode #19: block 37: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop2): __ext4_get_inode_loc:4351: comm kworker/u4:4: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop2) in ext4_reserve_inode_write:5834: Corrupt filesystem EXT4-fs error (device loop2): ext4_convert_unwritten_extents:4854: inode #19: comm kworker/u4:4: mark_inode_dirty error EXT4-fs (loop2): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop1): __ext4_get_inode_loc:4351: comm kworker/u4:4: Invalid inode table block 34360905424 in block_group 0