EXT4-fs error (device loop3): __ext4_get_inode_loc:4492: comm kworker/u4:14: Invalid inode table block 0 in block_group 0 EXT4-fs error (device loop3): __ext4_get_inode_loc:4492: comm kworker/u4:14: Invalid inode table block 0 in block_group 0 ================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:837 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xbab/0xdb0 fs/ext4/extents.c:953 Read of size 4 at addr ffff888149060b24 by task kworker/u4:14/16139 CPU: 1 PID: 16139 Comm: kworker/u4:14 Not tainted 6.1.25-syzkaller-00320-g78fe8913d1b2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 Workqueue: writeback wb_workfn (flush-7:3) Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:395 kasan_report+0x13c/0x170 mm/kasan/report.c:495 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350 ext4_ext_binsearch fs/ext4/extents.c:837 [inline] ext4_find_extent+0xbab/0xdb0 fs/ext4/extents.c:953 ext4_ext_map_blocks+0x255/0x71e0 fs/ext4/extents.c:4103 ext4_map_blocks+0xa42/0x1ce0 fs/ext4/inode.c:651 mpage_map_one_extent fs/ext4/inode.c:2421 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2474 [inline] ext4_writepages+0x1785/0x3fc0 fs/ext4/inode.c:2842 do_writepages+0x385/0x620 mm/page-writeback.c:2469 __writeback_single_inode+0xdc/0xb80 fs/fs-writeback.c:1590 writeback_sb_inodes+0xb33/0x18f0 fs/fs-writeback.c:1881 wb_writeback+0x3b9/0x9f0 fs/fs-writeback.c:2055 wb_do_writeback fs/fs-writeback.c:2198 [inline] wb_workfn+0x399/0x1030 fs/fs-writeback.c:2238 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2296 worker_thread+0xa5d/0x1260 kernel/workqueue.c:2443 kthread+0x26d/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the physical page: page:ffffea0005241800 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x1 pfn:0x149060 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea0005180408 ffffea000530b008 0000000000000000 raw: 0000000000000001 0000000000000004 00000000ffffff7f 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 0x8140dca(GFP_HIGHUSER_MOVABLE|__GFP_COMP|__GFP_ZERO|0x8000000), pid 464, tgid 282 (syz-fuzzer), ts 2169695900874, free_ts 3309351433083 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2574 prep_new_page mm/page_alloc.c:2581 [inline] get_page_from_freelist+0x2527/0x2600 mm/page_alloc.c:4374 __alloc_pages+0x3a1/0x780 mm/page_alloc.c:5640 __folio_alloc+0x15/0x40 mm/page_alloc.c:5672 __folio_alloc_node include/linux/gfp.h:245 [inline] folio_alloc include/linux/gfp.h:274 [inline] alloc_page_vma include/linux/gfp.h:283 [inline] do_anonymous_page mm/memory.c:4125 [inline] handle_pte_fault mm/memory.c:4964 [inline] __handle_mm_fault mm/memory.c:5108 [inline] handle_mm_fault+0x1d70/0x2d30 mm/memory.c:5229 do_user_addr_fault arch/x86/mm/fault.c:1428 [inline] handle_page_fault arch/x86/mm/fault.c:1519 [inline] exc_page_fault+0x454/0x640 arch/x86/mm/fault.c:1575 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:570 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1486 [inline] free_pcp_prepare mm/page_alloc.c:1560 [inline] free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3473 free_unref_page_list+0xf6/0x6c0 mm/page_alloc.c:3615 release_pages+0xf7f/0xfe0 mm/swap.c:1055 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:314 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline] tlb_flush_mmu_free mm/mmu_gather.c:254 [inline] tlb_flush_mmu mm/mmu_gather.c:261 [inline] tlb_finish_mmu+0x1e0/0x3f0 mm/mmu_gather.c:361 zap_page_range_single+0x59e/0x680 mm/memory.c:1787 madvise_dontneed_single_vma mm/madvise.c:810 [inline] madvise_dontneed_free mm/madvise.c:903 [inline] madvise_vma_behavior mm/madvise.c:1042 [inline] madvise_walk_vmas mm/madvise.c:1267 [inline] do_madvise+0x1796/0x3da0 mm/madvise.c:1446 __do_sys_madvise mm/madvise.c:1459 [inline] __se_sys_madvise mm/madvise.c:1457 [inline] __x64_sys_madvise+0xa8/0xc0 mm/madvise.c:1457 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+0x63/0xcd Memory state around the buggy address: ffff888149060a00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888149060a80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888149060b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888149060b80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888149060c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop3): ext4_map_blocks:731: inode #20: comm kworker/u4:14: lblock 0 mapped to illegal pblock 0 (length 7) EXT4-fs (loop3): Delayed block allocation failed for inode 20 at logical offset 0 with max blocks 7 with error 117 EXT4-fs (loop3): This should not happen!! Data will be lost EXT4-fs error (device loop3): __ext4_get_inode_loc:4492: comm kworker/u4:14: Invalid inode table block 0 in block_group 0