================================================================== 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 ffff88812621aa58 by task syz-executor.0/396 CPU: 0 PID: 396 Comm: syz-executor.0 Not tainted 5.15.153-syzkaller-1069977-ge787d6ac4af0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 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+0x269/0x74a0 fs/ext4/extents.c:4142 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 filemap_fdatawrite_wbc+0x248/0x2a0 mm/filemap.c:404 __filemap_fdatawrite_range mm/filemap.c:437 [inline] file_write_and_wait_range+0x1cb/0x2b0 mm/filemap.c:814 ext4_sync_file+0x1a2/0xa50 fs/ext4/fsync.c:151 vfs_fsync_range+0x17b/0x190 fs/sync.c:188 generic_write_sync include/linux/fs.h:3025 [inline] ext4_buffered_write_iter+0x568/0x610 fs/ext4/file.c:277 ext4_file_write_iter+0x443/0x1c80 call_write_iter include/linux/fs.h:2204 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0xd5d/0x1110 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 RIP: 0033:0x7fcfff27c859 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fcffedff0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fcfff39bf80 RCX: 00007fcfff27c859 RDX: 000000000208e24b RSI: 0000000020000040 RDI: 0000000000000005 RBP: 00007fcfff2d8ad0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fcfff39bf80 R15: 00007ffefe399498 The buggy address belongs to the page: page:ffffea0004988680 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x12621a flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffff8881f713c580 ffffea0004988648 0000000000000000 raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner info is not present (never set?) Memory state around the buggy address: ffff88812621a900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88812621a980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88812621aa00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88812621aa80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88812621ab00: 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: 1 PID: 396 Comm: syz-executor.0 Tainted: G B 5.15.153-syzkaller-1069977-ge787d6ac4af0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 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 84 d0 c9 ff 48 8b 3b 48 8b 74 24 48 48 8b 54 24 28 44 89 e9 45 89 f8 e8 4c 34 08 00 eb 58 e8 15 a7 87 ff <0f> 0b e8 0e a7 87 ff eb 3b e8 07 a7 87 ff eb 72 e8 00 a7 87 ff 31 RSP: 0018:ffffc90000f67260 EFLAGS: 00010293 RAX: ffffffff81e8994b RBX: dffffc0000000000 RCX: ffff88810bbc62c0 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc90000f67670 R08: ffffffff81e8730b R09: ffffed1021ced486 R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000 R13: ffffc90000f67540 R14: 0000000000000000 R15: 0000000000000000 FS: 00007fcffedff6c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffd63cfde78 CR3: 00000001229c2000 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 filemap_fdatawrite_wbc+0x248/0x2a0 mm/filemap.c:404 __filemap_fdatawrite_range mm/filemap.c:437 [inline] file_write_and_wait_range+0x1cb/0x2b0 mm/filemap.c:814 ext4_sync_file+0x1a2/0xa50 fs/ext4/fsync.c:151 vfs_fsync_range+0x17b/0x190 fs/sync.c:188 generic_write_sync include/linux/fs.h:3025 [inline] ext4_buffered_write_iter+0x568/0x610 fs/ext4/file.c:277 ext4_file_write_iter+0x443/0x1c80 call_write_iter include/linux/fs.h:2204 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0xd5d/0x1110 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 RIP: 0033:0x7fcfff27c859 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fcffedff0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fcfff39bf80 RCX: 00007fcfff27c859 RDX: 000000000208e24b RSI: 0000000020000040 RDI: 0000000000000005 RBP: 00007fcfff2d8ad0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fcfff39bf80 R15: 00007ffefe399498 Modules linked in: ---[ end trace 0acb1f9ed613f754 ]--- 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 84 d0 c9 ff 48 8b 3b 48 8b 74 24 48 48 8b 54 24 28 44 89 e9 45 89 f8 e8 4c 34 08 00 eb 58 e8 15 a7 87 ff <0f> 0b e8 0e a7 87 ff eb 3b e8 07 a7 87 ff eb 72 e8 00 a7 87 ff 31 RSP: 0018:ffffc90000f67260 EFLAGS: 00010293 RAX: ffffffff81e8994b RBX: dffffc0000000000 RCX: ffff88810bbc62c0 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc90000f67670 R08: ffffffff81e8730b R09: ffffed1021ced486 R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000 R13: ffffc90000f67540 R14: 0000000000000000 R15: 0000000000000000 FS: 00007fcffedff6c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f178adef000 CR3: 00000001229c2000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400