================================================================== 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 ffff888124d03784 by task syz-executor.5/417 CPU: 1 PID: 417 Comm: syz-executor.5 Not tainted 5.10.205-syzkaller-999740-g3d758d85a169 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 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+0x26d/0x6be0 fs/ext4/extents.c:4097 ext4_map_blocks+0xaa7/0x1ec0 fs/ext4/inode.c:646 mpage_map_one_extent fs/ext4/inode.c:2440 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2493 [inline] ext4_writepages+0x148b/0x3c00 fs/ext4/inode.c:2861 do_writepages+0x12e/0x270 mm/page-writeback.c:2358 __filemap_fdatawrite_range+0x33c/0x3f0 mm/filemap.c:427 file_write_and_wait_range+0x89/0x120 mm/filemap.c:766 ext4_sync_file+0x1a2/0xa30 fs/ext4/fsync.c:151 vfs_fsync_range+0x17b/0x190 fs/sync.c:202 generic_write_sync include/linux/fs.h:2868 [inline] ext4_buffered_write_iter+0x565/0x610 fs/ext4/file.c:278 ext4_file_write_iter+0x193/0x1c80 fs/ext4/file.c:685 call_write_iter include/linux/fs.h:2019 [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 RIP: 0033:0x7fa4dc58b859 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:00007fa4dc10e0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007fa4dc6aaf80 RCX: 00007fa4dc58b859 RDX: 000000000208e24b RSI: 0000000020000040 RDI: 0000000000000006 RBP: 00007fa4dc5e7ad0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fa4dc6aaf80 R15: 00007ffdabacc8a8 The buggy address belongs to the page: page:ffffea00049340c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x124d03 flags: 0x4000000000000000() raw: 4000000000000000 ffffea0004934108 ffffea0004934088 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: ffff888124d03680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888124d03700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888124d03780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888124d03800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888124d03880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop5): ext4_map_blocks:716: inode #19: block 7: comm syz-executor.5: lblock 7 mapped to illegal pblock 7 (length 9) EXT4-fs (loop5): Delayed block allocation failed for inode 19 at logical offset 7 with max blocks 9 with error 117 EXT4-fs (loop5): This should not happen!! Data will be lost