EXT4-fs error (device loop0): __ext4_get_inode_loc:4352: comm kworker/u4:2: Invalid inode table block 0 in block_group 0 ================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:827 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xbeb/0xe20 fs/ext4/extents.c:946 Read of size 4 at addr ffff888122f0b058 by task kworker/u4:2/45 CPU: 1 PID: 45 Comm: kworker/u4:2 Not tainted 5.15.184-syzkaller-1080580-g4032a894ccb2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Workqueue: writeback wb_workfn (flush-7:0) Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0xf1/0x140 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+0xbeb/0xe20 fs/ext4/extents.c:946 ext4_ext_map_blocks+0x1de/0x6270 fs/ext4/extents.c:4165 ext4_map_blocks+0x97b/0x1b20 fs/ext4/inode.c:674 mpage_map_one_extent fs/ext4/inode.c:2421 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2474 [inline] ext4_writepages+0x11e7/0x2f90 fs/ext4/inode.c:2842 do_writepages+0x48a/0x6c0 mm/page-writeback.c:2388 __writeback_single_inode+0xd5/0x9c0 fs/fs-writeback.c:1647 writeback_sb_inodes+0x9c0/0x1590 fs/fs-writeback.c:1930 wb_writeback+0x3f1/0x980 fs/fs-writeback.c:2106 wb_do_writeback fs/fs-writeback.c:2253 [inline] wb_workfn+0x38f/0xe20 fs/fs-writeback.c:2294 process_one_work+0x6be/0xba0 kernel/workqueue.c:2325 worker_thread+0xa59/0x1200 kernel/workqueue.c:2472 kthread+0x411/0x500 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 The buggy address belongs to the page: page:ffffea00048bc2c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x122f0b flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea00048bc248 ffffea00048bc208 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 301, ts 39597143238, free_ts 39617647299 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1c/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x2cc5/0x2d50 mm/page_alloc.c:4485 __alloc_pages+0x18f/0x440 mm/page_alloc.c:5781 __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:4068 [inline] handle_pte_fault+0xe89/0x2680 mm/memory.c:4908 __handle_mm_fault mm/memory.c:-1 [inline] do_handle_mm_fault+0x1a6d/0x1d50 mm/memory.c:5332 handle_mm_fault include/linux/mm.h:1836 [inline] do_user_addr_fault+0x841/0x1180 arch/x86/mm/fault.c:1418 handle_page_fault arch/x86/mm/fault.c:1509 [inline] exc_page_fault+0x51/0xb0 arch/x86/mm/fault.c:1565 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:606 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+0x542/0x550 mm/page_alloc.c:3534 free_unref_page_list+0x134/0x9d0 mm/page_alloc.c:3671 release_pages+0x1076/0x10d0 mm/swap.c:1009 free_pages_and_swap_cache+0x86/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 mm/mmu_gather.c:247 [inline] tlb_finish_mmu+0x175/0x300 mm/mmu_gather.c:338 unmap_region+0x315/0x360 mm/mmap.c:2680 __do_munmap+0xa0e/0xfe0 mm/mmap.c:2913 __vm_munmap+0x15b/0x2a0 mm/mmap.c:2966 __do_sys_munmap mm/mmap.c:2992 [inline] __se_sys_munmap mm/mmap.c:2988 [inline] __x64_sys_munmap+0x6b/0x80 mm/mmap.c:2988 x64_sys_call+0xc9/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:12 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Memory state around the buggy address: ffff888122f0af00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888122f0af80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888122f0b000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888122f0b080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888122f0b100: 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:2433! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 45 Comm: kworker/u4:2 Tainted: G B 5.15.184-syzkaller-1080580-g4032a894ccb2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Workqueue: writeback wb_workfn (flush-7:0) RIP: 0010:mpage_map_one_extent fs/ext4/inode.c:2433 [inline] RIP: 0010:mpage_map_and_submit_extent fs/ext4/inode.c:2474 [inline] RIP: 0010:ext4_writepages+0x2eed/0x2f90 fs/ext4/inode.c:2842 Code: 00 74 08 48 89 df e8 22 09 ce ff 48 8b 3b 48 8b 74 24 28 48 8b 54 24 30 44 89 e9 45 89 f0 e8 4a 9b 07 00 eb 51 e8 73 97 8f ff <0f> 0b e8 6c 97 8f ff eb 2f e8 65 97 8f ff eb 5f e8 5e 97 8f ff 31 RSP: 0018:ffffc900002ef100 EFLAGS: 00010293 RAX: ffffffff81d90d6d RBX: ffff888121d635f0 RCX: ffff888107fdbb40 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc900002ef470 R08: dffffc0000000000 R09: ffffed10243ac6b7 R10: ffffed10243ac6b7 R11: 1ffff110243ac6b6 R12: dffffc0000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffdf23eae38 CR3: 0000000105dd7000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: do_writepages+0x48a/0x6c0 mm/page-writeback.c:2388 __writeback_single_inode+0xd5/0x9c0 fs/fs-writeback.c:1647 writeback_sb_inodes+0x9c0/0x1590 fs/fs-writeback.c:1930 wb_writeback+0x3f1/0x980 fs/fs-writeback.c:2106 wb_do_writeback fs/fs-writeback.c:2253 [inline] wb_workfn+0x38f/0xe20 fs/fs-writeback.c:2294 process_one_work+0x6be/0xba0 kernel/workqueue.c:2325 worker_thread+0xa59/0x1200 kernel/workqueue.c:2472 kthread+0x411/0x500 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Modules linked in: ---[ end trace 067b72e7d160d8cd ]--- RIP: 0010:mpage_map_one_extent fs/ext4/inode.c:2433 [inline] RIP: 0010:mpage_map_and_submit_extent fs/ext4/inode.c:2474 [inline] RIP: 0010:ext4_writepages+0x2eed/0x2f90 fs/ext4/inode.c:2842 Code: 00 74 08 48 89 df e8 22 09 ce ff 48 8b 3b 48 8b 74 24 28 48 8b 54 24 30 44 89 e9 45 89 f0 e8 4a 9b 07 00 eb 51 e8 73 97 8f ff <0f> 0b e8 6c 97 8f ff eb 2f e8 65 97 8f ff eb 5f e8 5e 97 8f ff 31 RSP: 0018:ffffc900002ef100 EFLAGS: 00010293 RAX: ffffffff81d90d6d RBX: ffff888121d635f0 RCX: ffff888107fdbb40 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc900002ef470 R08: dffffc0000000000 R09: ffffed10243ac6b7 R10: ffffed10243ac6b7 R11: 1ffff110243ac6b6 R12: dffffc0000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffdf23eae38 CR3: 000000010d8dc000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400