==================================================================
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 ffff888114465d18 by task kworker/u4:11/1884
CPU: 0 PID: 1884 Comm: kworker/u4:11 Not tainted 5.15.189-syzkaller-00079-ga71626bd56a5 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Workqueue: writeback wb_workfn (flush-7:2)
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_map_blocks+0x1de/0x6280 fs/ext4/extents.c:4166
ext4_map_blocks+0x97b/0x1b20 fs/ext4/inode.c:674
mpage_map_one_extent fs/ext4/inode.c:2421 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2474 [inline]
ext4_writepages+0x11e7/0x2f90 fs/ext4/inode.c:2842
do_writepages+0x48a/0x6c0 mm/page-writeback.c:2388
__writeback_single_inode+0xd5/0x9c0 fs/fs-writeback.c:1647
writeback_sb_inodes+0x9c0/0x1590 fs/fs-writeback.c:1930
wb_writeback+0x3f1/0x980 fs/fs-writeback.c:2106
wb_do_writeback fs/fs-writeback.c:2253 [inline]
wb_workfn+0x38f/0xe20 fs/fs-writeback.c:2294
process_one_work+0x6be/0xba0 kernel/workqueue.c:2325
worker_thread+0xa59/0x1200 kernel/workqueue.c:2472
kthread+0x411/0x500 kernel/kthread.c:337
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
The buggy address belongs to the page:
page:ffffea0004511940 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x114465
flags: 0x4000000000000000(zone=1)
raw: 4000000000000000 ffffea000471fe88 ffffea0004ebe008 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 31804, ts 2815719601706, free_ts 2816324843923
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:591 [inline]
alloc_pages_node include/linux/gfp.h:605 [inline]
alloc_pages include/linux/gfp.h:618 [inline]
wp_page_copy+0x1c9/0x18f0 mm/memory.c:3221
do_wp_page+0x731/0xc90 mm/memory.c:-1
handle_pte_fault+0x73c/0x2680 mm/memory.c:4932
__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+0xd6/0x180 mm/mmu_gather.c:247
zap_pte_range mm/memory.c:1526 [inline]
zap_pmd_range mm/memory.c:1575 [inline]
zap_pud_range mm/memory.c:1604 [inline]
zap_p4d_range mm/memory.c:1625 [inline]
unmap_page_range+0x1bcb/0x1d90 mm/memory.c:1646
unmap_single_vma mm/memory.c:1691 [inline]
unmap_vmas+0x258/0x360 mm/memory.c:1723
exit_mmap+0x3e6/0x860 mm/mmap.c:3241
__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
get_signal+0x66a/0x1480 kernel/signal.c:2907
arch_do_signal_or_restart+0xc1/0x10f0 arch/x86/kernel/signal.c:867
handle_signal_work kernel/entry/common.c:154 [inline]
exit_to_user_mode_loop+0xa7/0xe0 kernel/entry/common.c:178
exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:214
Memory state around the buggy address:
ffff888114465c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888114465c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888114465d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888114465d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888114465e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
------------[ cut here ]------------
kernel BUG at fs/ext4/inode.c:2433!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 1884 Comm: kworker/u4:11 Tainted: G B 5.15.189-syzkaller-00079-ga71626bd56a5 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Workqueue: writeback wb_workfn (flush-7:2)
RIP: 0010:mpage_map_one_extent fs/ext4/inode.c:2433 [inline]
RIP: 0010:mpage_map_and_submit_extent fs/ext4/inode.c:2474 [inline]
RIP: 0010:ext4_writepages+0x2eed/0x2f90 fs/ext4/inode.c:2842
Code: 00 74 08 48 89 df e8 22 01 ce ff 48 8b 3b 48 8b 74 24 28 48 8b 54 24 30 44 89 e9 45 89 f0 e8 6a 9b 07 00 eb 51 e8 a3 88 8f ff <0f> 0b e8 9c 88 8f ff eb 2f e8 95 88 8f ff eb 5f e8 8e 88 8f ff 31
RSP: 0018:ffffc90001087100 EFLAGS: 00010293
RAX: ffffffff81d9272d RBX: ffff888109947060 RCX: ffff88810ee793c0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90001087470 R08: dffffc0000000000 R09: ffffed1021328e05
R10: ffffed1021328e05 R11: 1ffff11021328e04 R12: dffffc0000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c2f3650 CR3: 0000000122f85000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
do_writepages+0x48a/0x6c0 mm/page-writeback.c:2388
__writeback_single_inode+0xd5/0x9c0 fs/fs-writeback.c:1647
writeback_sb_inodes+0x9c0/0x1590 fs/fs-writeback.c:1930
wb_writeback+0x3f1/0x980 fs/fs-writeback.c:2106
wb_do_writeback fs/fs-writeback.c:2253 [inline]
wb_workfn+0x38f/0xe20 fs/fs-writeback.c:2294
process_one_work+0x6be/0xba0 kernel/workqueue.c:2325
worker_thread+0xa59/0x1200 kernel/workqueue.c:2472
kthread+0x411/0x500 kernel/kthread.c:337
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Modules linked in:
---[ end trace 5681c65eb523dc19 ]---
RIP: 0010:mpage_map_one_extent fs/ext4/inode.c:2433 [inline]
RIP: 0010:mpage_map_and_submit_extent fs/ext4/inode.c:2474 [inline]
RIP: 0010:ext4_writepages+0x2eed/0x2f90 fs/ext4/inode.c:2842
Code: 00 74 08 48 89 df e8 22 01 ce ff 48 8b 3b 48 8b 74 24 28 48 8b 54 24 30 44 89 e9 45 89 f0 e8 6a 9b 07 00 eb 51 e8 a3 88 8f ff <0f> 0b e8 9c 88 8f ff eb 2f e8 95 88 8f ff eb 5f e8 8e 88 8f ff 31
RSP: 0018:ffffc90001087100 EFLAGS: 00010293
RAX: ffffffff81d9272d RBX: ffff888109947060 RCX: ffff88810ee793c0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90001087470 R08: dffffc0000000000 R09: ffffed1021328e05
R10: ffffed1021328e05 R11: 1ffff11021328e04 R12: dffffc0000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fcda0830178 CR3: 000000010d2b8000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400