================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:827 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xbeb/0xe20 fs/ext4/extents.c:946 Read of size 4 at addr ffff88813014252c by task syz.0.397/1796 CPU: 0 PID: 1796 Comm: syz.0.397 Not tainted 5.15.189-syzkaller-android13-5.15.189_r00 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0xf1/0x140 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+0xbeb/0xe20 fs/ext4/extents.c:946 ext4_ext_map_blocks+0x1de/0x6280 fs/ext4/extents.c:4166 ext4_map_blocks+0x3a7/0x1b20 fs/ext4/inode.c:601 _ext4_get_block+0x1da/0x4e0 fs/ext4/inode.c:817 ext4_get_block_unwritten+0x2a/0x40 fs/ext4/inode.c:848 ext4_block_write_begin+0x556/0x1150 fs/ext4/inode.c:1102 ext4_write_begin+0x638/0x1220 fs/ext4/ext4_jbd2.h:-1 ext4_da_write_begin+0x2fa/0xb60 fs/ext4/inode.c:2988 generic_perform_write+0x2ad/0x670 mm/filemap.c:3869 ext4_buffered_write_iter+0x4ed/0x670 fs/ext4/file.c:270 ext4_file_write_iter+0x18c/0x14c0 fs/ext4/file.c:664 call_write_iter include/linux/fs.h:2212 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0x802/0xf70 fs/read_write.c:594 ksys_pwrite64 fs/read_write.c:701 [inline] __do_sys_pwrite64 fs/read_write.c:711 [inline] __se_sys_pwrite64 fs/read_write.c:708 [inline] __x64_sys_pwrite64+0x191/0x220 fs/read_write.c:708 x64_sys_call+0xa6/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:19 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f53262bdbe9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5324d05038 EFLAGS: 00000246 ORIG_RAX: 0000000000000012 RAX: ffffffffffffffda RBX: 00007f53264e5090 RCX: 00007f53262bdbe9 RDX: 00000000ffffff07 RSI: 0000200000000140 RDI: 0000000000000004 RBP: 00007f5326340e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000008000c61 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f53264e5128 R14: 00007f53264e5090 R15: 00007ffdd1350128 The buggy address belongs to the page: page:ffffea0004c05080 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x100 pfn:0x130142 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea0004aada48 ffffea0004c25848 0000000000000000 raw: 0000000000000100 0000000000000000 00000000ffffff7f 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 0x100cca(GFP_HIGHUSER_MOVABLE), pid 1624, ts 101261078366, free_ts 101728494184 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1c/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x2cc5/0x2d50 mm/page_alloc.c:4485 __alloc_pages+0x18f/0x440 mm/page_alloc.c:5795 __alloc_pages_node include/linux/gfp.h:595 [inline] alloc_pages_node include/linux/gfp.h:609 [inline] alloc_pages include/linux/gfp.h:622 [inline] shmem_alloc_page mm/shmem.c:1591 [inline] shmem_alloc_and_acct_page+0x42b/0x870 mm/shmem.c:1616 shmem_getpage_gfp+0xfe5/0x2310 mm/shmem.c:1912 shmem_fault+0x19d/0x510 mm/shmem.c:2124 __do_fault+0x264/0x2f0 mm/memory.c:4192 do_read_fault mm/memory.c:4556 [inline] do_fault mm/memory.c:4697 [inline] handle_pte_fault+0x1a57/0x2680 mm/memory.c:4911 __handle_mm_fault mm/memory.c:-1 [inline] do_handle_mm_fault+0x1a6d/0x1d50 mm/memory.c:5333 handle_mm_fault include/linux/mm.h:1836 [inline] faultin_page mm/gup.c:976 [inline] __get_user_pages+0x7ee/0x10a0 mm/gup.c:1197 populate_vma_page_range mm/gup.c:1529 [inline] __mm_populate+0x319/0x460 mm/gup.c:1638 mm_populate include/linux/mm.h:2693 [inline] vm_mmap_pgoff+0x247/0x410 mm/util.c:560 ksys_mmap_pgoff+0xf6/0x1d0 mm/mmap.c:1643 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:93 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __x64_sys_mmap+0xfa/0x110 arch/x86/kernel/sys_x86_64.c:86 x64_sys_call+0x83/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:10 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1472 [inline] free_pcp_prepare mm/page_alloc.c:1544 [inline] free_unref_page_prepare+0x542/0x550 mm/page_alloc.c:3534 free_unref_page_list+0x134/0x9d0 mm/page_alloc.c:3671 release_pages+0xfda/0x1030 mm/swap.c:1014 __pagevec_release+0x71/0xe0 mm/swap.c:1034 pagevec_release include/linux/pagevec.h:81 [inline] shmem_undo_range+0x53f/0x13d0 mm/shmem.c:969 shmem_truncate_range mm/shmem.c:1068 [inline] shmem_evict_inode+0x1fd/0x9c0 mm/shmem.c:1150 evict+0x485/0x870 fs/inode.c:650 iput_final fs/inode.c:1779 [inline] iput+0x635/0x7c0 fs/inode.c:1805 dentry_unlink_inode+0x32f/0x3e0 fs/dcache.c:380 __dentry_kill+0x44f/0x650 fs/dcache.c:586 dentry_kill+0xc0/0x2a0 fs/dcache.c:-1 dput+0x47/0x90 fs/dcache.c:893 __fput+0x580/0x8b0 fs/file_table.c:319 ____fput+0x15/0x20 fs/file_table.c:339 task_work_run+0x127/0x190 kernel/task_work.c:188 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0xa7e/0x27a0 kernel/exit.c:889 Memory state around the buggy address: ffff888130142400: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888130142480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888130142500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888130142580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888130142600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================