EXT4-fs error (device loop0): __ext4_get_inode_loc:4347: comm kworker/u4:1: 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+0xbab/0xdb0 fs/ext4/extents.c:946
Read of size 4 at addr ffff88811e57e058 by task kworker/u4:1/10
CPU: 1 PID: 10 Comm: kworker/u4:1 Not tainted 5.15.98-syzkaller-00348-g7364b7abbafb #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Workqueue: writeback wb_workfn (flush-7:0)
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
print_address_description+0x87/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:427 [inline]
kasan_report+0x179/0x1c0 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+0xbab/0xdb0 fs/ext4/extents.c:946
ext4_ext_map_blocks+0x254/0x7250 fs/ext4/extents.c:4103
ext4_map_blocks+0xaa7/0x1e30 fs/ext4/inode.c:646
mpage_map_one_extent fs/ext4/inode.c:2419 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2472 [inline]
ext4_writepages+0x162a/0x4010 fs/ext4/inode.c:2840
do_writepages+0x40e/0x670 mm/page-writeback.c:2366
__writeback_single_inode+0xdf/0xa70 fs/fs-writeback.c:1622
writeback_sb_inodes+0xb2e/0x1910 fs/fs-writeback.c:1905
wb_writeback+0x3b9/0x9e0 fs/fs-writeback.c:2079
wb_do_writeback fs/fs-writeback.c:2222 [inline]
wb_workfn+0x3d9/0x1110 fs/fs-writeback.c:2263
process_one_work+0x6bb/0xc10 kernel/workqueue.c:2313
worker_thread+0xad5/0x12a0 kernel/workqueue.c:2460
kthread+0x421/0x510 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 :298
The buggy address belongs to the page:
page:ffffea0004795f80 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x11e57e
flags: 0x4000000000000000(zone=1)
raw: 4000000000000000 ffffea0004795fc8 ffffea00043663c8 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 322, ts 18363426224, free_ts 18363519432
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2502
prep_new_page mm/page_alloc.c:2508 [inline]
get_page_from_freelist+0x2c14/0x2cf0 mm/page_alloc.c:4291
__alloc_pages+0x386/0x7b0 mm/page_alloc.c:5569
__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]
__page_cache_alloc include/linux/pagemap.h:305 [inline]
pagecache_get_page+0xb18/0xeb0 mm/filemap.c:1940
grab_cache_page_write_begin+0x5d/0xa0 mm/filemap.c:3785
ext4_write_begin+0x29d/0x13d0 fs/ext4/inode.c:1194
ext4_da_write_begin+0x4a2/0xc30 fs/ext4/inode.c:2986
generic_perform_write+0x2bc/0x5a0 mm/filemap.c:3831
ext4_buffered_write_iter+0x49c/0x630 fs/ext4/file.c:271
ext4_file_write_iter+0x443/0x1cc0
call_write_iter include/linux/fs.h:2157 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0xd8a/0x1160 fs/read_write.c:594
ksys_write+0x199/0x2c0 fs/read_write.c:647
__do_sys_write fs/read_write.c:659 [inline]
__se_sys_write fs/read_write.c:656 [inline]
__x64_sys_write+0x7b/0x90 fs/read_write.c:656
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+0x61/0xcb
page last free stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
free_pages_prepare mm/page_alloc.c:1370 [inline]
free_pcp_prepare mm/page_alloc.c:1442 [inline]
free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3441
free_unref_page+0xac/0x2c0 mm/page_alloc.c:3521
__put_single_page mm/swap.c:98 [inline]
__put_page+0xb0/0xe0 mm/swap.c:129
put_page include/linux/mm.h:1295 [inline]
ext4_write_begin+0xfb2/0x13d0 fs/ext4/inode.c:1276
ext4_da_write_begin+0x4a2/0xc30 fs/ext4/inode.c:2986
generic_perform_write+0x2bc/0x5a0 mm/filemap.c:3831
ext4_buffered_write_iter+0x49c/0x630 fs/ext4/file.c:271
ext4_file_write_iter+0x443/0x1cc0
call_write_iter include/linux/fs.h:2157 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0xd8a/0x1160 fs/read_write.c:594
ksys_write+0x199/0x2c0 fs/read_write.c:647
__do_sys_write fs/read_write.c:659 [inline]
__se_sys_write fs/read_write.c:656 [inline]
__x64_sys_write+0x7b/0x90 fs/read_write.c:656
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+0x61/0xcb
Memory state around the buggy address:
ffff88811e57df00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88811e57df80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88811e57e000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88811e57e080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88811e57e100: 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:2431!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 10 Comm: kworker/u4:1 Tainted: G B 5.15.98-syzkaller-00348-g7364b7abbafb #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Workqueue: writeback wb_workfn (flush-7:0)
RIP: 0010:mpage_map_one_extent fs/ext4/inode.c:2431 [inline]
RIP: 0010:mpage_map_and_submit_extent fs/ext4/inode.c:2472 [inline]
RIP: 0010:ext4_writepages+0x3f45/0x4010 fs/ext4/inode.c:2840
Code: 00 74 08 48 89 df e8 0a f8 c9 ff 48 8b 3b 48 8b 74 24 48 48 8b 54 24 28 44 89 e9 45 89 f8 e8 82 42 08 00 eb 60 e8 3b c5 88 ff <0f> 0b e8 34 c5 88 ff eb 3b e8 2d c5 88 ff eb 7a e8 26 c5 88 ff 31
RSP: 0018:ffffc900000a7000 EFLAGS: 00010293
RAX: ffffffff81e69aa5 RBX: dffffc0000000000 RCX: ffff8881002593c0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900000a7410 R08: ffffffff81e6746d R09: ffffed102203e024
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: ffffc900000a72e0 R14: 0000000000000000 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f909ee45508 CR3: 000000000660f000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
do_writepages+0x40e/0x670 mm/page-writeback.c:2366
__writeback_single_inode+0xdf/0xa70 fs/fs-writeback.c:1622
writeback_sb_inodes+0xb2e/0x1910 fs/fs-writeback.c:1905
wb_writeback+0x3b9/0x9e0 fs/fs-writeback.c:2079
wb_do_writeback fs/fs-writeback.c:2222 [inline]
wb_workfn+0x3d9/0x1110 fs/fs-writeback.c:2263
process_one_work+0x6bb/0xc10 kernel/workqueue.c:2313
worker_thread+0xad5/0x12a0 kernel/workqueue.c:2460
kthread+0x421/0x510 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 :298
Modules linked in:
---[ end trace b68c083357dd2f44 ]---
RIP: 0010:mpage_map_one_extent fs/ext4/inode.c:2431 [inline]
RIP: 0010:mpage_map_and_submit_extent fs/ext4/inode.c:2472 [inline]
RIP: 0010:ext4_writepages+0x3f45/0x4010 fs/ext4/inode.c:2840
Code: 00 74 08 48 89 df e8 0a f8 c9 ff 48 8b 3b 48 8b 74 24 48 48 8b 54 24 28 44 89 e9 45 89 f8 e8 82 42 08 00 eb 60 e8 3b c5 88 ff <0f> 0b e8 34 c5 88 ff eb 3b e8 2d c5 88 ff eb 7a e8 26 c5 88 ff 31
RSP: 0018:ffffc900000a7000 EFLAGS: 00010293
RAX: ffffffff81e69aa5 RBX: dffffc0000000000 RCX: ffff8881002593c0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900000a7410 R08: ffffffff81e6746d R09: ffffed102203e024
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: ffffc900000a72e0 R14: 0000000000000000 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f909ee45508 CR3: 000000010b8f2000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400