==================================================================
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 ffff88812e59f044 by task syz.3.19/493
CPU: 0 PID: 493 Comm: syz.3.19 Not tainted syzkaller #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_remove_space+0x2bc/0x4180 fs/ext4/extents.c:2834
ext4_punch_hole+0x77c/0xbd0 fs/ext4/inode.c:4131
ext4_fallocate+0x2b6/0x1de0 fs/ext4/extents.c:4765
vfs_fallocate+0x4b4/0x590 fs/open.c:309
ksys_fallocate fs/open.c:332 [inline]
__do_sys_fallocate fs/open.c:340 [inline]
__se_sys_fallocate fs/open.c:338 [inline]
__x64_sys_fallocate+0xc0/0x110 fs/open.c:338
x64_sys_call+0x7ec/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:286
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:0x7f74112fa969
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:00007f7410d4a038 EFLAGS: 00000246 ORIG_RAX: 000000000000011d
RAX: ffffffffffffffda RBX: 00007f7411522080 RCX: 00007f74112fa969
RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000004
RBP: 00007f741137cab1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000001a00 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f7411522080 R15: 00007ffde218c8e8
The buggy address belongs to the page:
page:ffffea0004b967c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x12e59f
flags: 0x4000000000000000(zone=1)
raw: 4000000000000000 ffffea0004b96808 ffffea0004b96788 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 0x100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), pid 473, ts 47000695234, free_ts 47164049440
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]
do_anonymous_page mm/memory.c:4069 [inline]
handle_pte_fault+0xe89/0x2680 mm/memory.c:4909
__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]
do_user_addr_fault+0x841/0x1180 arch/x86/mm/fault.c:1418
handle_page_fault arch/x86/mm/fault.c:1509 [inline]
exc_page_fault+0x51/0xb0 arch/x86/mm/fault.c:1565
asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:606
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
free_pages_and_swap_cache+0x86/0xa0 mm/swap_state.c:320
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+0x175/0x300 mm/mmu_gather.c:338
exit_mmap+0x40f/0x860 mm/mmap.c:3244
__mmput+0x93/0x320 kernel/fork.c:1180
mmput+0x50/0x150 kernel/fork.c:1203
exit_mm kernel/exit.c:554 [inline]
do_exit+0x9d2/0x27a0 kernel/exit.c:876
do_group_exit+0x141/0x310 kernel/exit.c:1003
__do_sys_exit_group kernel/exit.c:1014 [inline]
__se_sys_exit_group kernel/exit.c:1012 [inline]
__x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1012
x64_sys_call+0x832/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:232
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
Memory state around the buggy address:
ffff88812e59ef00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88812e59ef80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88812e59f000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88812e59f080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88812e59f100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
------------[ cut here ]------------
kernel BUG at fs/ext4/extents.c:3186!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 493 Comm: syz.3.19 Tainted: G B syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
RIP: 0010:ext4_split_extent_at+0xe77/0xe90 fs/ext4/extents.c:3186
Code: 6f fb ff ff 48 89 df 49 89 d7 e8 84 82 d3 ff 4c 89 fa e9 5c fb ff ff e8 57 0a 95 ff 0f 0b e8 50 0a 95 ff 0f 0b e8 49 0a 95 ff <0f> 0b e8 42 0a 95 ff 0f 0b e8 3b 0a 95 ff 0f 0b e8 34 0a 95 ff 0f
RSP: 0018:ffffc90002147940 EFLAGS: 00010293
RAX: ffffffff81d3aca7 RBX: 1ffff11025caa9f2 RCX: ffff888119e6e2c0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001
RBP: ffffc90002147ab0 R08: 0000000000000000 R09: 0000000050000028
R10: fffffbfff0e1804c R11: 1ffffffff0e1804c R12: dffffc0000000000
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000000
FS: 00007f7410d4a6c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000072000 CR3: 0000000119e94000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
ext4_force_split_extent_at fs/ext4/extents.c:319 [inline]
ext4_ext_remove_space+0x64b/0x4180 fs/ext4/extents.c:2880
ext4_punch_hole+0x77c/0xbd0 fs/ext4/inode.c:4131
ext4_fallocate+0x2b6/0x1de0 fs/ext4/extents.c:4765
vfs_fallocate+0x4b4/0x590 fs/open.c:309
ksys_fallocate fs/open.c:332 [inline]
__do_sys_fallocate fs/open.c:340 [inline]
__se_sys_fallocate fs/open.c:338 [inline]
__x64_sys_fallocate+0xc0/0x110 fs/open.c:338
x64_sys_call+0x7ec/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:286
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:0x7f74112fa969
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:00007f7410d4a038 EFLAGS: 00000246 ORIG_RAX: 000000000000011d
RAX: ffffffffffffffda RBX: 00007f7411522080 RCX: 00007f74112fa969
RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000004
RBP: 00007f741137cab1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000001a00 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f7411522080 R15: 00007ffde218c8e8
Modules linked in:
---[ end trace 29acf85d34a47a01 ]---
RIP: 0010:ext4_split_extent_at+0xe77/0xe90 fs/ext4/extents.c:3186
Code: 6f fb ff ff 48 89 df 49 89 d7 e8 84 82 d3 ff 4c 89 fa e9 5c fb ff ff e8 57 0a 95 ff 0f 0b e8 50 0a 95 ff 0f 0b e8 49 0a 95 ff <0f> 0b e8 42 0a 95 ff 0f 0b e8 3b 0a 95 ff 0f 0b e8 34 0a 95 ff 0f
RSP: 0018:ffffc90002147940 EFLAGS: 00010293
RAX: ffffffff81d3aca7 RBX: 1ffff11025caa9f2 RCX: ffff888119e6e2c0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001
RBP: ffffc90002147ab0 R08: 0000000000000000 R09: 0000000050000028
R10: fffffbfff0e1804c R11: 1ffffffff0e1804c R12: dffffc0000000000
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000000
FS: 00007f7410d4a6c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f276a213000 CR3: 0000000119e94000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400