================================================================== 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 ffff8880305a84d0 by task syz-executor203/6176 CPU: 0 UID: 0 PID: 6176 Comm: syz-executor203 Not tainted 6.15.0-rc7-syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/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+0x546/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+0x54b/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:0x7fe0cfa1ecc9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 1d 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:00007fe0cf1c3168 EFLAGS: 00000246 ORIG_RAX: 0000000000000012 RAX: ffffffffffffffda RBX: 00007fe0cfaa64a8 RCX: 00007fe0cfa1ecc9 RDX: 000000000000fdef RSI: 0000200000000140 RDI: 0000000000000005 RBP: 00007fe0cfaa64a0 R08: 00007fe0cf1c36c0 R09: 0000000000000000 R10: 000000000000fecc R11: 0000000000000246 R12: 00007fe0cfaa64ac R13: 000000000000000b R14: 00007ffe9ef5be70 R15: 00007ffe9ef5bf58 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff8880305a83c0 pfn:0x305a8 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 00fff00000000000 ffffea0000c8c788 ffffea0000cbaf88 0000000000000000 raw: ffff8880305a83c0 0000000000000000 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 0x2dc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_ZERO|__GFP_NOWARN), pid 2, tgid 2 (kthreadd), ts 102490701319, free_ts 104374540589 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1d8/0x230 mm/page_alloc.c:1714 prep_new_page mm/page_alloc.c:1722 [inline] get_page_from_freelist+0x21c7/0x22a0 mm/page_alloc.c:3684 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4966 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2301 alloc_frozen_pages_noprof mm/mempolicy.c:2372 [inline] alloc_pages_noprof+0xa9/0x190 mm/mempolicy.c:2392 vm_area_alloc_pages mm/vmalloc.c:3592 [inline] __vmalloc_area_node mm/vmalloc.c:3670 [inline] __vmalloc_node_range_noprof+0x8fe/0x12c0 mm/vmalloc.c:3845 __vmalloc_node_noprof+0x7d/0x90 mm/vmalloc.c:3908 alloc_thread_stack_node kernel/fork.c:314 [inline] dup_task_struct+0x3e7/0x860 kernel/fork.c:1137 copy_process+0x544/0x3b80 kernel/fork.c:2260 kernel_clone+0x224/0x7f0 kernel/fork.c:2845 kernel_thread+0x10c/0x160 kernel/fork.c:2907 create_kthread kernel/kthread.c:487 [inline] kthreadd+0x575/0x770 kernel/kthread.c:847 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 page last free pid 5908 tgid 5908 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1258 [inline] __free_frozen_pages+0xb05/0xcd0 mm/page_alloc.c:2721 vfree+0x1a6/0x330 mm/vmalloc.c:3384 delayed_vfree_work+0x55/0x80 mm/vmalloc.c:3304 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xade/0x17a0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x711/0x8a0 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff8880305a8380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880305a8400: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8880305a8480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8880305a8500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880305a8580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================