EXT4-fs error (device loop4): __ext4_get_inode_loc:4437: comm kworker/u4:1: Invalid inode table block 1633771873 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 ffff8881193ce84c by task kworker/u4:1/9 CPU: 1 PID: 9 Comm: kworker/u4:1 Tainted: G W 5.10.226-syzkaller-00709-ge5e5644ea27f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Workqueue: writeback wb_workfn (flush-7:4) 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 __writeback_inodes_wb fs/fs-writeback.c:1804 [inline] wb_writeback+0x4b7/0xc60 fs/fs-writeback.c:1910 wb_check_old_data_flush fs/fs-writeback.c:2012 [inline] wb_do_writeback fs/fs-writeback.c:2065 [inline] wb_workfn+0xb3d/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 Allocated by task 95: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:430 [inline] __kasan_slab_alloc+0xb1/0xe0 mm/kasan/common.c:463 kasan_slab_alloc include/linux/kasan.h:244 [inline] slab_post_alloc_hook+0x61/0x2f0 mm/slab.h:583 slab_alloc_node mm/slub.c:2947 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x168/0x2e0 mm/slub.c:2960 getname_flags+0xba/0x520 fs/namei.c:141 user_path_at_empty+0x2d/0x50 fs/namei.c:2740 do_readlinkat+0x114/0x3a0 fs/stat.c:414 __do_sys_readlink fs/stat.c:447 [inline] __se_sys_readlink fs/stat.c:444 [inline] __x64_sys_readlink+0x7f/0x90 fs/stat.c:444 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 95: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x121/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1595 [inline] slab_free_freelist_hook+0xc0/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kmem_cache_free+0xa9/0x1e0 mm/slub.c:3219 putname fs/namei.c:262 [inline] filename_lookup+0x515/0x6f0 fs/namei.c:2470 user_path_at_empty+0x40/0x50 fs/namei.c:2740 do_readlinkat+0x114/0x3a0 fs/stat.c:414 __do_sys_readlink fs/stat.c:447 [inline] __se_sys_readlink fs/stat.c:444 [inline] __x64_sys_readlink+0x7f/0x90 fs/stat.c:444 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff8881193ce600 which belongs to the cache names_cache of size 4096 The buggy address is located 588 bytes inside of 4096-byte region [ffff8881193ce600, ffff8881193cf600) The buggy address belongs to the page: page:ffffea000464f200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1193c8 head:ffffea000464f200 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100192900 raw: 0000000000000000 0000000000070007 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 95, ts 112770063490, free_ts 112648904711 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 allocate_slab mm/slub.c:1808 [inline] new_slab+0x80/0x400 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x302/0x4b0 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x1b9/0x2e0 mm/slub.c:2960 getname_flags+0xba/0x520 fs/namei.c:141 user_path_at_empty+0x2d/0x50 fs/namei.c:2740 do_readlinkat+0x114/0x3a0 fs/stat.c:414 __do_sys_readlink fs/stat.c:447 [inline] __se_sys_readlink fs/stat.c:444 [inline] __x64_sys_readlink+0x7f/0x90 fs/stat.c:444 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb 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_pages_ok+0x82c/0x850 mm/page_alloc.c:1629 free_the_page+0x76/0x370 mm/page_alloc.c:5409 __free_pages+0x67/0xc0 mm/page_alloc.c:5418 __free_slab+0xcf/0x190 mm/slub.c:1894 free_slab mm/slub.c:1909 [inline] discard_slab mm/slub.c:1915 [inline] unfreeze_partials+0x15e/0x190 mm/slub.c:2410 put_cpu_partial+0xbf/0x180 mm/slub.c:2446 __slab_free+0x2c8/0x3a0 mm/slub.c:3095 do_slab_free mm/slub.c:3191 [inline] ___cache_free+0x111/0x130 mm/slub.c:3210 qlink_free+0x50/0x90 mm/kasan/quarantine.c:157 qlist_free_all+0x47/0xb0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x15a/0x170 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:440 kasan_slab_alloc include/linux/kasan.h:244 [inline] slab_post_alloc_hook+0x61/0x2f0 mm/slab.h:583 slab_alloc_node mm/slub.c:2947 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x168/0x2e0 mm/slub.c:2960 getname_flags+0xba/0x520 fs/namei.c:141 getname+0x19/0x20 fs/namei.c:212 Memory state around the buggy address: ffff8881193ce700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881193ce780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881193ce800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881193ce880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881193ce900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ kernel BUG at fs/ext4/inode.c:2463! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 9 Comm: kworker/u4:1 Tainted: G B W 5.10.226-syzkaller-00709-ge5e5644ea27f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Workqueue: writeback wb_workfn (flush-7:4) 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:ffffc900000970a0 EFLAGS: 00010293 RAX: ffffffff81de7504 RBX: dffffc0000000000 RCX: ffff888100254f00 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc90000097490 R08: ffffffff81de5109 R09: ffffed10220ede2b R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc900000973b0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f3501b9e710 CR3: 0000000119d0c000 CR4: 00000000003506b0 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 __writeback_inodes_wb fs/fs-writeback.c:1804 [inline] wb_writeback+0x4b7/0xc60 fs/fs-writeback.c:1910 wb_check_old_data_flush fs/fs-writeback.c:2012 [inline] wb_do_writeback fs/fs-writeback.c:2065 [inline] wb_workfn+0xb3d/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 6389d03c195f9afb ]--- 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:ffffc900000970a0 EFLAGS: 00010293 RAX: ffffffff81de7504 RBX: dffffc0000000000 RCX: ffff888100254f00 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc90000097490 R08: ffffffff81de5109 R09: ffffed10220ede2b R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc900000973b0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f2140034178 CR3: 000000010c0d0000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400