EXT4-fs error (device loop0): __ext4_get_inode_loc:4409: comm kworker/u4:3: 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 ffff88811eb21058 by task kworker/u4:3/301 CPU: 1 PID: 301 Comm: kworker/u4:3 Not tainted 5.10.214-syzkaller-1002110-gd3c4d815bf09 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/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:4137 ext4_map_blocks+0xa65/0x1d10 fs/ext4/inode.c:644 mpage_map_one_extent fs/ext4/inode.c:2423 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2476 [inline] ext4_writepages+0x148b/0x3c00 fs/ext4/inode.c:2844 do_writepages+0x12e/0x270 mm/page-writeback.c:2358 __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:299 The buggy address belongs to the page: page:ffffea00047ac840 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x11eb21 flags: 0x4000000000000000() raw: 4000000000000000 ffffea00047ac888 ffffea00047a7008 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 0x101cca(GFP_HIGHUSER_MOVABLE|__GFP_WRITE), pid 347, ts 41130595823, free_ts 41130724732 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:5346 __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] __page_cache_alloc include/linux/pagemap.h:290 [inline] pagecache_get_page+0x669/0x950 mm/filemap.c:1848 grab_cache_page_write_begin+0x5d/0xa0 mm/filemap.c:3459 ext4_write_begin+0x29f/0x1730 fs/ext4/inode.c:1178 ext4_da_write_begin+0x49d/0xf60 fs/ext4/inode.c:3004 generic_perform_write+0x2cd/0x570 mm/filemap.c:3509 ext4_buffered_write_iter+0x482/0x610 fs/ext4/file.c:271 ext4_file_write_iter+0x193/0x1c80 fs/ext4/file.c:685 call_write_iter include/linux/fs.h:2021 [inline] new_sync_write fs/read_write.c:518 [inline] vfs_write+0xb55/0xe70 fs/read_write.c:605 ksys_write+0x199/0x2c0 fs/read_write.c:658 __do_sys_write fs/read_write.c:670 [inline] __se_sys_write fs/read_write.c:667 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:667 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 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+0x7e/0x1c0 mm/page_alloc.c:3391 __put_single_page mm/swap.c:104 [inline] __put_page+0xb1/0xe0 mm/swap.c:135 put_page include/linux/mm.h:1257 [inline] ext4_write_begin+0x12c6/0x1730 fs/ext4/inode.c:1260 ext4_da_write_begin+0x49d/0xf60 fs/ext4/inode.c:3004 generic_perform_write+0x2cd/0x570 mm/filemap.c:3509 ext4_buffered_write_iter+0x482/0x610 fs/ext4/file.c:271 ext4_file_write_iter+0x193/0x1c80 fs/ext4/file.c:685 call_write_iter include/linux/fs.h:2021 [inline] new_sync_write fs/read_write.c:518 [inline] vfs_write+0xb55/0xe70 fs/read_write.c:605 ksys_write+0x199/0x2c0 fs/read_write.c:658 __do_sys_write fs/read_write.c:670 [inline] __se_sys_write fs/read_write.c:667 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:667 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Memory state around the buggy address: ffff88811eb20f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88811eb20f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88811eb21000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88811eb21080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811eb21100: 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:2435! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 301 Comm: kworker/u4:3 Tainted: G B 5.10.214-syzkaller-1002110-gd3c4d815bf09 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Workqueue: writeback wb_workfn (flush-7:0) RIP: 0010:mpage_map_one_extent fs/ext4/inode.c:2435 [inline] RIP: 0010:mpage_map_and_submit_extent fs/ext4/inode.c:2476 [inline] RIP: 0010:ext4_writepages+0x3b44/0x3c00 fs/ext4/inode.c:2844 Code: 00 74 08 48 89 df e8 4b e4 c9 ff 48 8b 3b 48 8b 74 24 28 48 8b 54 24 50 44 89 e1 45 89 f8 e8 53 d8 07 00 eb 5d e8 3c 54 8c ff <0f> 0b e8 35 54 8c ff eb 3b e8 2e 54 8c ff eb 77 e8 27 54 8c ff 31 RSP: 0018:ffffc90000c770a0 EFLAGS: 00010293 RAX: ffffffff81de5764 RBX: dffffc0000000000 RCX: ffff88811f042780 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc90000c77490 R08: ffffffff81de3369 R09: ffffed1022043786 R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90000c773b0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8881f7200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffc9e4ffff8 CR3: 00000001059ac000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: do_writepages+0x12e/0x270 mm/page-writeback.c:2358 __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:299 Modules linked in: ---[ end trace 792937f349053be0 ]--- RIP: 0010:mpage_map_one_extent fs/ext4/inode.c:2435 [inline] RIP: 0010:mpage_map_and_submit_extent fs/ext4/inode.c:2476 [inline] RIP: 0010:ext4_writepages+0x3b44/0x3c00 fs/ext4/inode.c:2844 Code: 00 74 08 48 89 df e8 4b e4 c9 ff 48 8b 3b 48 8b 74 24 28 48 8b 54 24 50 44 89 e1 45 89 f8 e8 53 d8 07 00 eb 5d e8 3c 54 8c ff <0f> 0b e8 35 54 8c ff eb 3b e8 2e 54 8c ff eb 77 e8 27 54 8c ff 31 RSP: 0018:ffffc90000c770a0 EFLAGS: 00010293 RAX: ffffffff81de5764 RBX: dffffc0000000000 RCX: ffff88811f042780 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc90000c77490 R08: ffffffff81de3369 R09: ffffed1022043786 R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90000c773b0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8881f7300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000c000e72000 CR3: 00000001059ac000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400