EXT4-fs error (device loop0): __ext4_get_inode_loc:4340: 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 ffff888123f0c058 by task kworker/u4:1/10
CPU: 0 PID: 10 Comm: kworker/u4:1 Not tainted 5.15.122-syzkaller-06757-g1463976ddc64 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/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/0x1e00 fs/ext4/inode.c:646
mpage_map_one_extent fs/ext4/inode.c:2409 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2462 [inline]
ext4_writepages+0x1628/0x4000 fs/ext4/inode.c:2830
do_writepages+0x40e/0x670 mm/page-writeback.c:2366
__writeback_single_inode+0xdf/0xa70 fs/fs-writeback.c:1625
writeback_sb_inodes+0xb2e/0x1910 fs/fs-writeback.c:1908
wb_writeback+0x3b9/0x9e0 fs/fs-writeback.c:2082
wb_do_writeback fs/fs-writeback.c:2225 [inline]
wb_workfn+0x3d9/0x1110 fs/fs-writeback.c:2266
process_one_work+0x6bb/0xc10 kernel/workqueue.c:2317
worker_thread+0xad5/0x12a0 kernel/workqueue.c:2464
kthread+0x421/0x510 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
The buggy address belongs to the page:
page:ffffea00048fc300 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x123f0c
flags: 0x4000000000000000(zone=1)
raw: 4000000000000000 ffffea00048fc308 ffffea00048fc308 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner info is not present (never set?)
Memory state around the buggy address:
ffff888123f0bf00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888123f0bf80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888123f0c000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888123f0c080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888123f0c100: 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:2421!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 10 Comm: kworker/u4:1 Tainted: G B 5.15.122-syzkaller-06757-g1463976ddc64 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
Workqueue: writeback wb_workfn (flush-7:0)
RIP: 0010:mpage_map_one_extent fs/ext4/inode.c:2421 [inline]
RIP: 0010:mpage_map_and_submit_extent fs/ext4/inode.c:2462 [inline]
RIP: 0010:ext4_writepages+0x3f4b/0x4000 fs/ext4/inode.c:2830
Code: 00 74 08 48 89 df e8 44 f5 c9 ff 48 8b 3b 48 8b 74 24 48 48 8b 54 24 28 44 89 e9 45 89 f8 e8 8c 27 08 00 eb 58 e8 c5 71 88 ff <0f> 0b e8 be 71 88 ff eb 3b e8 b7 71 88 ff eb 72 e8 b0 71 88 ff 31
RSP: 0018:ffffc900000a7000 EFLAGS: 00010293
RAX: ffffffff81e7734b RBX: dffffc0000000000 RCX: ffff8881002593c0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900000a7410 R08: ffffffff81e74d0b R09: ffffed10246b3bd4
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: ffffc900000a72e0 R14: 0000000000000000 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c001127000 CR3: 0000000120daf000 CR4: 00000000003506b0
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:1625
writeback_sb_inodes+0xb2e/0x1910 fs/fs-writeback.c:1908
wb_writeback+0x3b9/0x9e0 fs/fs-writeback.c:2082
wb_do_writeback fs/fs-writeback.c:2225 [inline]
wb_workfn+0x3d9/0x1110 fs/fs-writeback.c:2266
process_one_work+0x6bb/0xc10 kernel/workqueue.c:2317
worker_thread+0xad5/0x12a0 kernel/workqueue.c:2464
kthread+0x421/0x510 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
Modules linked in:
---[ end trace 69a4378da5f3d49c ]---
RIP: 0010:mpage_map_one_extent fs/ext4/inode.c:2421 [inline]
RIP: 0010:mpage_map_and_submit_extent fs/ext4/inode.c:2462 [inline]
RIP: 0010:ext4_writepages+0x3f4b/0x4000 fs/ext4/inode.c:2830
Code: 00 74 08 48 89 df e8 44 f5 c9 ff 48 8b 3b 48 8b 74 24 48 48 8b 54 24 28 44 89 e9 45 89 f8 e8 8c 27 08 00 eb 58 e8 c5 71 88 ff <0f> 0b e8 be 71 88 ff eb 3b e8 b7 71 88 ff eb 72 e8 b0 71 88 ff 31
RSP: 0018:ffffc900000a7000 EFLAGS: 00010293
RAX: ffffffff81e7734b RBX: dffffc0000000000 RCX: ffff8881002593c0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900000a7410 R08: ffffffff81e74d0b R09: ffffed10246b3bd4
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: ffffc900000a72e0 R14: 0000000000000000 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000c001127000 CR3: 000000010b875000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400