EXT4-fs error (device loop0): __ext4_get_inode_loc:4437: comm kworker/u4:0: Invalid inode table block 0 in block_group 0 EXT4-fs error (device loop0): __ext4_get_inode_loc:4437: comm kworker/u4:0: Invalid inode table block 0 in block_group 0 ================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:826 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xbab/0xdb0 fs/ext4/extents.c:945 Read of size 4 at addr ffff88811f7d6078 by task kworker/u4:0/7 CPU: 1 PID: 7 Comm: kworker/u4:0 Not tainted 5.10.226-syzkaller-1003431-ge5e5644ea27f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: writeback wb_workfn (flush-7:0) Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_ext_binsearch fs/ext4/extents.c:826 [inline] ext4_find_extent+0xbab/0xdb0 fs/ext4/extents.c:945 ext4_ext_map_blocks+0x26a/0x6ee0 fs/ext4/extents.c:4138 ext4_map_blocks+0xa65/0x1d10 fs/ext4/inode.c:673 mpage_map_one_extent fs/ext4/inode.c:2451 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2504 [inline] ext4_writepages+0x148b/0x3c00 fs/ext4/inode.c:2872 do_writepages+0x12e/0x270 mm/page-writeback.c:2380 __writeback_single_inode+0xd7/0xac0 fs/fs-writeback.c:1470 writeback_sb_inodes+0x99c/0x16b0 fs/fs-writeback.c:1733 wb_writeback+0x404/0xc60 fs/fs-writeback.c:1908 wb_do_writeback fs/fs-writeback.c:2053 [inline] wb_workfn+0x3d9/0x1110 fs/fs-writeback.c:2094 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301 worker_thread+0xaea/0x1510 kernel/workqueue.c:2447 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 The buggy address belongs to the page: page:ffffea00047df580 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x11f7d6 flags: 0x4000000000000000() raw: 4000000000000000 dead000000000100 dead000000000122 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 0x8100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO|0x8000000), pid 290, ts 28130017571, free_ts 29187873303 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5348 __alloc_pages include/linux/gfp.h:544 [inline] __alloc_pages_node include/linux/gfp.h:557 [inline] alloc_pages_node include/linux/gfp.h:571 [inline] alloc_pages include/linux/gfp.h:590 [inline] do_anonymous_page mm/memory.c:3935 [inline] handle_pte_fault+0x1782/0x3e30 mm/memory.c:4758 ___handle_speculative_fault mm/memory.c:5191 [inline] __handle_speculative_fault+0x1370/0x1e90 mm/memory.c:5240 handle_speculative_fault include/linux/mm.h:1838 [inline] do_user_addr_fault arch/x86/mm/fault.c:1285 [inline] handle_page_fault arch/x86/mm/fault.c:1428 [inline] exc_page_fault+0x234/0x5b0 arch/x86/mm/fault.c:1484 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:571 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] free_pcp_prepare mm/page_alloc.c:1421 [inline] free_unref_page_prepare+0x2ae/0x2d0 mm/page_alloc.c:3336 free_unref_page_list+0x122/0xb20 mm/page_alloc.c:3443 release_pages+0xea0/0xef0 mm/swap.c:1103 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:356 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:1385 [inline] zap_pmd_range mm/memory.c:1435 [inline] zap_pud_range mm/memory.c:1464 [inline] zap_p4d_range mm/memory.c:1485 [inline] unmap_page_range+0x1f34/0x23b0 mm/memory.c:1506 unmap_single_vma mm/memory.c:1551 [inline] unmap_vmas+0x37f/0x4f0 mm/memory.c:1583 exit_mmap+0x2f2/0x5c0 mm/mmap.c:3355 __mmput+0x95/0x2d0 kernel/fork.c:1153 mmput+0x59/0x170 kernel/fork.c:1176 exit_mm kernel/exit.c:539 [inline] do_exit+0xbda/0x2a50 kernel/exit.c:850 do_group_exit+0x141/0x310 kernel/exit.c:985 get_signal+0x10a0/0x1410 kernel/signal.c:2790 arch_do_signal_or_restart+0xbd/0x17c0 arch/x86/kernel/signal.c:805 handle_signal_work kernel/entry/common.c:145 [inline] exit_to_user_mode_loop+0x9b/0xd0 kernel/entry/common.c:169 exit_to_user_mode_prepare kernel/entry/common.c:199 [inline] syscall_exit_to_user_mode+0xa2/0x1a0 kernel/entry/common.c:274 Memory state around the buggy address: ffff88811f7d5f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811f7d5f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88811f7d6000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88811f7d6080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811f7d6100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ------------[ cut here ]------------ kernel BUG at fs/ext4/inode.c:2463! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 7 Comm: kworker/u4:0 Tainted: G B 5.10.226-syzkaller-1003431-ge5e5644ea27f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: writeback wb_workfn (flush-7:0) RIP: 0010:mpage_map_one_extent fs/ext4/inode.c:2463 [inline] RIP: 0010:mpage_map_and_submit_extent fs/ext4/inode.c:2504 [inline] RIP: 0010:ext4_writepages+0x3b44/0x3c00 fs/ext4/inode.c:2872 Code: 00 74 08 48 89 df e8 eb d1 c9 ff 48 8b 3b 48 8b 74 24 28 48 8b 54 24 50 44 89 e1 45 89 f8 e8 c3 dc 07 00 eb 5d e8 ec 37 8c ff <0f> 0b e8 e5 37 8c ff eb 3b e8 de 37 8c ff eb 77 e8 d7 37 8c ff 31 RSP: 0018:ffffc900000770a0 EFLAGS: 00010293 RAX: ffffffff81de7504 RBX: dffffc0000000000 RCX: ffff888100253b40 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc90000077490 R08: ffffffff81de5109 R09: ffffed1024100d6e R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc900000773b0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffffe074ca8 CR3: 000000010f08d000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: do_writepages+0x12e/0x270 mm/page-writeback.c:2380 __writeback_single_inode+0xd7/0xac0 fs/fs-writeback.c:1470 writeback_sb_inodes+0x99c/0x16b0 fs/fs-writeback.c:1733 wb_writeback+0x404/0xc60 fs/fs-writeback.c:1908 wb_do_writeback fs/fs-writeback.c:2053 [inline] wb_workfn+0x3d9/0x1110 fs/fs-writeback.c:2094 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301 worker_thread+0xaea/0x1510 kernel/workqueue.c:2447 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Modules linked in: ---[ end trace 7961ed6249d15a24 ]--- RIP: 0010:mpage_map_one_extent fs/ext4/inode.c:2463 [inline] RIP: 0010:mpage_map_and_submit_extent fs/ext4/inode.c:2504 [inline] RIP: 0010:ext4_writepages+0x3b44/0x3c00 fs/ext4/inode.c:2872 Code: 00 74 08 48 89 df e8 eb d1 c9 ff 48 8b 3b 48 8b 74 24 28 48 8b 54 24 50 44 89 e1 45 89 f8 e8 c3 dc 07 00 eb 5d e8 ec 37 8c ff <0f> 0b e8 e5 37 8c ff eb 3b e8 de 37 8c ff eb 77 e8 d7 37 8c ff 31 RSP: 0018:ffffc900000770a0 EFLAGS: 00010293 RAX: ffffffff81de7504 RBX: dffffc0000000000 RCX: ffff888100253b40 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc90000077490 R08: ffffffff81de5109 R09: ffffed1024100d6e R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc900000773b0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffffe074ca8 CR3: 000000011ecbc000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400