================================================================== 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 ffff88811bbe0784 by task kworker/u4:2/45 CPU: 1 PID: 45 Comm: kworker/u4:2 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:ffffea00046ef800 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x11bbe0 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea00046efa08 ffffea00046ef588 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 293, ts 26658105106, free_ts 27636578840 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: ffff88811bbe0680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811bbe0700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88811bbe0780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88811bbe0800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811bbe0880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop4): ext4_map_blocks:739: inode #19: block 1: comm kworker/u4:2: lblock 1 mapped to illegal pblock 1 (length 1) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4853: inode #19: block 1: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop4): __ext4_get_inode_loc:4351: comm kworker/u4:2: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop4) in ext4_reserve_inode_write:5834: Corrupt filesystem EXT4-fs error (device loop4): ext4_convert_unwritten_extents:4854: inode #19: comm kworker/u4:2: mark_inode_dirty error EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop4): ext4_map_blocks:739: inode #19: block 2: comm kworker/u4:2: lblock 2 mapped to illegal pblock 2 (length 1) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4853: inode #19: block 2: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop4): __ext4_get_inode_loc:4351: comm kworker/u4:2: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop4) in ext4_reserve_inode_write:5834: Corrupt filesystem EXT4-fs error (device loop4): ext4_convert_unwritten_extents:4854: inode #19: comm kworker/u4:2: mark_inode_dirty error EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop4): ext4_map_blocks:739: inode #19: block 3: comm kworker/u4:2: lblock 3 mapped to illegal pblock 3 (length 1) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4853: inode #19: block 3: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4853: inode #19: block 4: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4853: inode #19: block 5: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4853: inode #19: block 6: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4853: inode #19: block 7: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4853: inode #19: block 8: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop4): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4853: inode #19: block 9: len 1: ext4_ext_map_blocks returned -117 EXT4-fs warning (device loop4): ext4_convert_unwritten_extents:4853: inode #19: block 10: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop5): ext4_map_blocks:739: inode #19: block 195: comm kworker/u4:2: lblock 3 mapped to illegal pblock 195 (length 1) EXT4-fs warning (device loop5): ext4_convert_unwritten_extents:4853: inode #19: block 3: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop5): __ext4_get_inode_loc:4351: comm kworker/u4:2: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop5) in ext4_reserve_inode_write:5834: Corrupt filesystem EXT4-fs error (device loop5): ext4_convert_unwritten_extents:4854: inode #19: comm kworker/u4:2: mark_inode_dirty error EXT4-fs (loop5): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop5): ext4_find_extent:929: inode #19: comm kworker/u4:2: pblk 208 bad header/extent: invalid magic - magic 6f69, entries 29795, max 9324(0), depth 20297(0) EXT4-fs warning (device loop5): ext4_convert_unwritten_extents:4853: inode #19: block 4: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop5): __ext4_get_inode_loc:4351: comm kworker/u4:2: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop5) in ext4_reserve_inode_write:5834: Corrupt filesystem EXT4-fs error (device loop5): ext4_convert_unwritten_extents:4854: inode #19: comm kworker/u4:2: mark_inode_dirty error EXT4-fs (loop5): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs error (device loop2): ext4_map_blocks:739: inode #19: block 205: comm kworker/u4:2: lblock 13 mapped to illegal pblock 205 (length 1) EXT4-fs warning (device loop2): ext4_convert_unwritten_extents:4853: inode #19: block 13: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop2): __ext4_get_inode_loc:4351: comm kworker/u4:2: 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:2: 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 loop2): ext4_map_blocks:739: inode #19: block 206: comm kworker/u4:2: lblock 14 mapped to illegal pblock 206 (length 1) EXT4-fs warning (device loop2): ext4_convert_unwritten_extents:4853: inode #19: block 14: len 1: ext4_ext_map_blocks returned -117 EXT4-fs error (device loop2): __ext4_get_inode_loc:4351: comm kworker/u4:2: 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:2: 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 loop2): ext4_map_blocks:739: inode #19: block 105959006307159: comm kworker/u4:2: lblock 15 mapped to illegal pblock 105959006307159 (length 1) EXT4-fs warning (device loop2): ext4_convert_unwritten_extents:4853: inode #19: block 15: len 1: ext4_ext_map_blocks returned -117 EXT4-fs (loop2): failed to convert unwritten extents to written extents -- potential data loss! (inode 19, error -117) EXT4-fs warning (device loop2): ext4_convert_unwritten_extents:4853: inode #19: block 16: len 1: ext4_ext_map_blocks returned -117 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:2: Invalid inode table block 34360905424 in block_group 0 EXT4-fs error (device loop3): ext4_map_blocks:739: inode #19: block 235: comm kworker/u4:2: lblock 27 mapped to illegal pblock 235 (length 1)