================================================================== BUG: KASAN: use-after-free in ext4_ext_correct_indexes+0x72/0x5b0 fs/ext4/extents.c:1712 Read of size 8 at addr ffff8880296ac050 by task syz.2.800/9968 CPU: 0 UID: 0 PID: 9968 Comm: syz.2.800 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xba/0x230 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 ext4_ext_correct_indexes+0x72/0x5b0 fs/ext4/extents.c:1712 ext4_ext_insert_extent+0x2007/0x4b50 fs/ext4/extents.c:2188 ext4_ext_map_blocks+0x1a72/0x6b80 fs/ext4/extents.c:4404 ext4_map_create_blocks fs/ext4/inode.c:613 [inline] ext4_map_blocks+0x8da/0x1830 fs/ext4/inode.c:816 _ext4_get_block+0x1e3/0x470 fs/ext4/inode.c:916 ext4_get_block_unwritten+0x2e/0x100 fs/ext4/inode.c:949 ext4_block_write_begin+0xb14/0x1950 fs/ext4/inode.c:1203 ext4_write_begin+0xb40/0x1870 fs/ext4/ext4_jbd2.h:-1 ext4_da_write_begin+0x355/0xd30 fs/ext4/inode.c:3130 generic_perform_write+0x2af/0x8b0 mm/filemap.c:4314 ext4_buffered_write_iter+0xd0/0x3a0 fs/ext4/file.c:299 ext4_file_write_iter+0x299/0x1c20 fs/ext4/file.c:-1 new_sync_write fs/read_write.c:593 [inline] vfs_write+0x629/0xba0 fs/read_write.c:686 ksys_pwrite64 fs/read_write.c:793 [inline] __do_sys_pwrite64 fs/read_write.c:801 [inline] __se_sys_pwrite64 fs/read_write.c:798 [inline] __x64_sys_pwrite64+0x19c/0x230 fs/read_write.c:798 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xe2/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5601f490b9 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f56011a6028 EFLAGS: 00000246 ORIG_RAX: 0000000000000012 RAX: ffffffffffffffda RBX: 00007f5602175fa0 RCX: 00007f5601f490b9 RDX: 000000000000fdef RSI: 0000200000000140 RDI: 0000000000000004 RBP: 00007f5601fdb9c4 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000fecc R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f5602175fa0 R15: 00007ffc90a6fc88 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x296ac flags: 0x80000000000000(node=0|zone=1) page_type: f0(buddy) raw: 0080000000000000 ffffea0000c77208 ffffea0000eac408 0000000000000000 raw: 0000000000000000 0000000000000002 00000000f0000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO|__GFP_COMP), pid 6329, tgid 6329 (syz-executor), ts 231102599294, free_ts 231411799571 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x228/0x280 mm/page_alloc.c:1884 prep_new_page mm/page_alloc.c:1892 [inline] get_page_from_freelist+0x28bb/0x2950 mm/page_alloc.c:3945 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5240 alloc_pages_mpol+0xd1/0x380 mm/mempolicy.c:2486 alloc_frozen_pages_noprof mm/mempolicy.c:2557 [inline] alloc_pages_noprof+0xce/0x1e0 mm/mempolicy.c:2577 pagetable_alloc_noprof include/linux/mm.h:3190 [inline] __pte_alloc_one_noprof include/asm-generic/pgalloc.h:76 [inline] pte_alloc_one+0x23/0x380 arch/x86/mm/pgtable.c:18 __pte_alloc+0x25/0x1a0 mm/memory.c:453 copy_pte_range mm/memory.c:1237 [inline] copy_pmd_range+0x71e2/0x7a00 mm/memory.c:1392 copy_pud_range mm/memory.c:1429 [inline] copy_p4d_range mm/memory.c:1453 [inline] copy_page_range+0xaf9/0x1120 mm/memory.c:1535 dup_mmap+0xf7c/0x1b70 mm/mmap.c:1827 dup_mm kernel/fork.c:1529 [inline] copy_mm+0x13b/0x4b0 kernel/fork.c:1581 copy_process+0x16db/0x3a90 kernel/fork.c:2221 kernel_clone+0x249/0x7f0 kernel/fork.c:2651 __do_sys_clone kernel/fork.c:2792 [inline] __se_sys_clone kernel/fork.c:2776 [inline] __x64_sys_clone+0x1b6/0x230 kernel/fork.c:2776 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xe2/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 20 tgid 20 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1433 [inline] __free_frozen_pages+0xfc1/0x1130 mm/page_alloc.c:2973 __tlb_remove_table_free mm/mmu_gather.c:227 [inline] tlb_remove_table_rcu+0x85/0x100 mm/mmu_gather.c:290 rcu_do_batch kernel/rcu/tree.c:2605 [inline] rcu_core kernel/rcu/tree.c:2857 [inline] rcu_cpu_kthread+0xbba/0x1b10 kernel/rcu/tree.c:2945 smpboot_thread_fn+0x541/0xa50 kernel/smpboot.c:160 kthread+0x726/0x8b0 kernel/kthread.c:463 ret_from_fork+0x51b/0xa40 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Memory state around the buggy address: ffff8880296abf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880296abf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880296ac000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8880296ac080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880296ac100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================