================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:827 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xbc4/0xdd0 fs/ext4/extents.c:946 Read of size 4 at addr ffff888066891070 by task syz-executor.0/3966 CPU: 0 PID: 3966 Comm: syz-executor.0 Not tainted 5.15.167-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 ext4_ext_binsearch fs/ext4/extents.c:827 [inline] ext4_find_extent+0xbc4/0xdd0 fs/ext4/extents.c:946 ext4_ext_map_blocks+0x2da/0x7630 fs/ext4/extents.c:4144 ext4_map_blocks+0xa66/0x1c70 fs/ext4/inode.c:672 _ext4_get_block+0x23b/0x660 fs/ext4/inode.c:815 __block_write_begin_int+0x60b/0x1650 fs/buffer.c:2012 __block_write_begin fs/buffer.c:2062 [inline] block_page_mkwrite+0x210/0x280 fs/buffer.c:2525 ext4_page_mkwrite+0x3e9/0x1290 fs/ext4/inode.c:6202 do_page_mkwrite+0x1a9/0x440 mm/memory.c:2892 wp_page_shared+0x179/0x690 mm/memory.c:3229 handle_pte_fault mm/memory.c:4638 [inline] __handle_mm_fault mm/memory.c:4755 [inline] handle_mm_fault+0x2a3d/0x5960 mm/memory.c:4853 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 RIP: 0033:0x7fa511488cc7 Code: ce 48 ff c7 48 01 fe 48 8d 54 11 80 0f 1f 80 00 00 00 00 c5 fe 6f 0e c5 fe 6f 56 20 c5 fe 6f 5e 40 c5 fe 6f 66 60 48 83 ee 80 fd 7f 0f c5 fd 7f 57 20 c5 fd 7f 5f 40 c5 fd 7f 67 60 48 83 ef RSP: 002b:00007fff385a59a8 EFLAGS: 00010203 RAX: 0000000020003600 RBX: 00007fff385a5ab8 RCX: 0000000020003600 RDX: 00000000200036a9 RSI: 00007fa51104b7b0 RDI: 0000000020003620 RBP: 0000000000000001 R08: 0000000000000000 R09: 00007fa5115c6f8c R10: 00007fff385a5ae0 R11: 0000000000000246 R12: 00007fa51104b6f0 R13: fffffffffffffffe R14: 00007fa51102b000 R15: 00007fa51104b6f8 The buggy address belongs to the page: page:ffffea00019a2440 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x66891 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001bea048 ffffea00019a1388 0000000000000000 raw: 0000000000000001 0000000000000000 00000000ffffffff 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 0x1100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), pid 3965, ts 67215109395, free_ts 67217266670 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423 alloc_pages_vma+0x39a/0x800 mm/mempolicy.c:2146 do_anonymous_page mm/memory.c:3808 [inline] handle_pte_fault mm/memory.c:4618 [inline] __handle_mm_fault mm/memory.c:4755 [inline] handle_mm_fault+0x2f49/0x5960 mm/memory.c:4853 do_user_addr_fault arch/x86/mm/fault.c:1357 [inline] handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x271/0x700 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page_list+0x1f7/0x8e0 mm/page_alloc.c:3433 release_pages+0x1bb9/0x1f40 mm/swap.c:963 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu mm/mmu_gather.c:247 [inline] tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:338 exit_mmap+0x3cd/0x670 mm/mmap.c:3188 __mmput+0x112/0x3b0 kernel/fork.c:1126 exit_mm+0x688/0x7f0 kernel/exit.c:550 do_exit+0x626/0x2480 kernel/exit.c:861 do_group_exit+0x144/0x310 kernel/exit.c:996 __do_sys_exit_group kernel/exit.c:1007 [inline] __se_sys_exit_group kernel/exit.c:1005 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1005 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Memory state around the buggy address: ffff888066890f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888066890f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888066891000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff888066891080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888066891100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================