================================================================== 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 ffff88811b675a58 by task kworker/u4:1/10 CPU: 1 PID: 10 Comm: kworker/u4:1 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:ffffea00046d9d40 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x11b675 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea0004386088 ffffea0004385f88 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 0x100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), pid 292, ts 26671455462, free_ts 27743577332 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] do_anonymous_page mm/memory.c:4037 [inline] handle_pte_fault+0xe7e/0x25c0 mm/memory.c:4874 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: ffff88811b675900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811b675980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88811b675a00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88811b675a80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811b675b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop1): ext4_map_blocks:739: inode #19: block 3: comm kworker/u4:1: lblock 3 mapped to illegal pblock 3 (length 1) EXT4-fs warning (device loop1): ext4_convert_unwritten_extents:4853: inode #19: block 3: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop1): __ext4_get_inode_loc:4351: comm kworker/u4:1: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop1) in ext4_reserve_inode_write:5834: Corrupt filesystem EXT4-fs error (device loop1): ext4_convert_unwritten_extents:4854: inode #19: comm kworker/u4:1: mark_inode_dirty error EXT4-fs (loop1): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop1): ext4_ext_split:1072: inode #19: comm kworker/u4:1: p_ext > EXT_MAX_EXTENT!