EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: writeback. ================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:840 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xae6/0xcc0 fs/ext4/extents.c:955 Read of size 4 at addr ffff888073c6fc84 by task syz-executor236/5881 CPU: 1 UID: 0 PID: 5881 Comm: syz-executor236 Not tainted 6.15.0-rc5-syzkaller-00038-g707df3375124 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/29/2025 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xb4/0x290 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 ext4_ext_binsearch fs/ext4/extents.c:840 [inline] ext4_find_extent+0xae6/0xcc0 fs/ext4/extents.c:955 ext4_ext_map_blocks+0x26f/0x67c0 fs/ext4/extents.c:4205 ext4_map_create_blocks fs/ext4/inode.c:520 [inline] ext4_map_blocks+0x807/0x1740 fs/ext4/inode.c:706 _ext4_get_block+0x200/0x4c0 fs/ext4/inode.c:785 ext4_get_block_unwritten+0x2e/0x100 fs/ext4/inode.c:818 ext4_block_write_begin+0x543/0x1290 fs/ext4/inode.c:1067 ext4_write_begin+0x6f6/0x12c0 fs/ext4/ext4_jbd2.h:-1 ext4_da_write_begin+0x33a/0xa60 fs/ext4/inode.c:2932 generic_perform_write+0x2c4/0x910 mm/filemap.c:4103 ext4_buffered_write_iter+0xce/0x3a0 fs/ext4/file.c:299 ext4_file_write_iter+0x298/0x1bc0 fs/ext4/file.c:-1 new_sync_write fs/read_write.c:591 [inline] vfs_write+0x548/0xa90 fs/read_write.c:684 ksys_pwrite64 fs/read_write.c:791 [inline] __do_sys_pwrite64 fs/read_write.c:799 [inline] __se_sys_pwrite64 fs/read_write.c:796 [inline] __x64_sys_pwrite64+0x193/0x220 fs/read_write.c:796 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f934322adc9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 18 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:00007f93431df218 EFLAGS: 00000246 ORIG_RAX: 0000000000000012 RAX: ffffffffffffffda RBX: 00007f93432b26c8 RCX: 00007f934322adc9 RDX: 000000000000fdef RSI: 0000200000000140 RDI: 0000000000000004 RBP: 00007f93432b26c0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000e7c R11: 0000000000000246 R12: 00007f934327f630 R13: 0000200000000040 R14: 0032656c69662f2e R15: 00007f934327f06b The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:ffff88807ea4f930 index:0x32 pfn:0x73c6f memcg:ffff88801b2ec000 aops:shmem_aops ino:b dentry name(?):"memfd:syzkaller" flags: 0xfff0000002003c(referenced|uptodate|dirty|lru|swapbacked|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff0000002003c ffffea0001cf1b88 ffffea0001cf9388 ffff88807ea4f930 raw: 0000000000000032 0000000000000000 00000001ffffffff ffff88801b2ec000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 5902, tgid 5901 (syz-executor236), ts 87511136257, free_ts 79216329071 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1d8/0x230 mm/page_alloc.c:1718 prep_new_page mm/page_alloc.c:1726 [inline] get_page_from_freelist+0x21c7/0x22a0 mm/page_alloc.c:3688 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4970 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2301 folio_alloc_mpol_noprof+0x39/0x70 mm/mempolicy.c:2320 shmem_alloc_folio mm/shmem.c:1854 [inline] shmem_alloc_and_add_folio+0x447/0xf60 mm/shmem.c:1893 shmem_get_folio_gfp+0x597/0x15f0 mm/shmem.c:2533 shmem_get_folio mm/shmem.c:2639 [inline] shmem_write_begin+0xf7/0x2b0 mm/shmem.c:3289 generic_perform_write+0x2c4/0x910 mm/filemap.c:4103 shmem_file_write_iter+0xf8/0x120 mm/shmem.c:3464 new_sync_write fs/read_write.c:591 [inline] vfs_write+0x548/0xa90 fs/read_write.c:684 ksys_write+0x145/0x250 fs/read_write.c:736 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5803 tgid 5803 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] free_unref_folios+0xb70/0x1490 mm/page_alloc.c:2782 folios_put_refs+0x559/0x640 mm/swap.c:992 free_pages_and_swap_cache+0x277/0x520 mm/swap_state.c:267 __tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline] tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:397 [inline] tlb_flush_mmu+0x3a0/0x680 mm/mmu_gather.c:404 tlb_finish_mmu+0xc3/0x1d0 mm/mmu_gather.c:496 vms_clear_ptes+0x42c/0x540 mm/vma.c:1191 vms_complete_munmap_vmas+0x206/0x8a0 mm/vma.c:1233 do_vmi_align_munmap+0x358/0x420 mm/vma.c:1492 do_vmi_munmap+0x253/0x2e0 mm/vma.c:1540 __vm_munmap+0x23b/0x3d0 mm/vma.c:3013 __do_sys_munmap mm/mmap.c:1084 [inline] __se_sys_munmap mm/mmap.c:1081 [inline] __x64_sys_munmap+0x60/0x70 mm/mmap.c:1081 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888073c6fb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888073c6fc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888073c6fc80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff888073c6fd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888073c6fd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================