==================================================================
BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:837 [inline]
BUG: KASAN: use-after-free in ext4_find_extent+0xbe8/0xce0 fs/ext4/extents.c:953
Read of size 4 at addr ffff888073c147e0 by task kworker/u4:5/946
CPU: 0 PID: 946 Comm: kworker/u4:5 Not tainted 6.7.0-rc7-syzkaller-00003-gfbafc3e621c3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Workqueue: writeback wb_workfn (flush-7:0)
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:475
kasan_report+0xda/0x110 mm/kasan/report.c:588
ext4_ext_binsearch fs/ext4/extents.c:837 [inline]
ext4_find_extent+0xbe8/0xce0 fs/ext4/extents.c:953
ext4_ext_map_blocks+0x26b/0x5ae0 fs/ext4/extents.c:4101
ext4_map_blocks+0x619/0x1770 fs/ext4/inode.c:621
mpage_map_one_extent fs/ext4/inode.c:2169 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2222 [inline]
ext4_do_writepages+0x184e/0x3350 fs/ext4/inode.c:2685
ext4_writepages+0x30c/0x780 fs/ext4/inode.c:2774
do_writepages+0x1b4/0x690 mm/page-writeback.c:2553
__writeback_single_inode+0x158/0xe90 fs/fs-writeback.c:1625
writeback_sb_inodes+0x599/0x1080 fs/fs-writeback.c:1916
wb_writeback+0x2a5/0xaa0 fs/fs-writeback.c:2092
wb_do_writeback fs/fs-writeback.c:2239 [inline]
wb_workfn+0x29c/0xfe0 fs/fs-writeback.c:2279
process_one_work+0x886/0x15d0 kernel/workqueue.c:2627
process_scheduled_works kernel/workqueue.c:2700 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2781
kthread+0x2c6/0x3a0 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
The buggy address belongs to the physical page:
page:ffffea0001cf0500 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x73c14
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000000 dead000000000100 dead000000000122 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 0x140dca(GFP_HIGHUSER_MOVABLE|__GFP_COMP|__GFP_ZERO), pid 5048, tgid 5048 (sshd), ts 46944198017, free_ts 47025991886
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1537
prep_new_page mm/page_alloc.c:1544 [inline]
get_page_from_freelist+0xa25/0x36d0 mm/page_alloc.c:3312
__alloc_pages+0x22e/0x2420 mm/page_alloc.c:4568
alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133
vma_alloc_folio+0xad/0x220 mm/mempolicy.c:2172
do_anonymous_page mm/memory.c:4172 [inline]
do_pte_missing mm/memory.c:3729 [inline]
handle_pte_fault mm/memory.c:5039 [inline]
__handle_mm_fault+0xe07/0x3d70 mm/memory.c:5180
handle_mm_fault+0x47a/0xa10 mm/memory.c:5345
do_user_addr_fault+0x30b/0x1000 arch/x86/mm/fault.c:1364
handle_page_fault arch/x86/mm/fault.c:1505 [inline]
exc_page_fault+0x5d/0xc0 arch/x86/mm/fault.c:1561
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1137 [inline]
free_unref_page_prepare+0x4fa/0xaa0 mm/page_alloc.c:2347
free_unref_page_list+0xe6/0xb40 mm/page_alloc.c:2533
release_pages+0x32a/0x14f0 mm/swap.c:1042
tlb_batch_pages_flush+0x9a/0x190 mm/mmu_gather.c:98
tlb_flush_mmu_free mm/mmu_gather.c:293 [inline]
tlb_flush_mmu mm/mmu_gather.c:300 [inline]
tlb_finish_mmu+0x14b/0x6f0 mm/mmu_gather.c:392
unmap_region.constprop.0+0x2e6/0x3b0 mm/mmap.c:2341
do_vmi_align_munmap+0xde6/0x1600 mm/mmap.c:2657
do_vmi_munmap+0x20e/0x450 mm/mmap.c:2725
__vm_munmap+0x144/0x390 mm/mmap.c:3012
__do_sys_munmap mm/mmap.c:3029 [inline]
__se_sys_munmap mm/mmap.c:3026 [inline]
__x64_sys_munmap+0x62/0x80 mm/mmap.c:3026
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
Memory state around the buggy address:
ffff888073c14680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888073c14700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888073c14780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888073c14800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888073c14880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
==================================================================
BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:837 [inline]
BUG: KASAN: use-after-free in ext4_find_extent+0xbe8/0xce0 fs/ext4/extents.c:953
Read of size 4 at addr ffff888073c147e0 by task kworker/u4:5/946
CPU: 1 PID: 946 Comm: kworker/u4:5 Tainted: G B 6.7.0-rc7-syzkaller-00003-gfbafc3e621c3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Workqueue: writeback wb_workfn (flush-7:0)
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:475
kasan_report+0xda/0x110 mm/kasan/report.c:588
ext4_ext_binsearch fs/ext4/extents.c:837 [inline]
ext4_find_extent+0xbe8/0xce0 fs/ext4/extents.c:953
ext4_ext_map_blocks+0x26b/0x5ae0 fs/ext4/extents.c:4101
ext4_map_blocks+0x619/0x1770 fs/ext4/inode.c:621
mpage_map_one_extent fs/ext4/inode.c:2169 [inline]
mpage_map_and_submit_extent fs/ext4/inode.c:2222 [inline]
ext4_do_writepages+0x184e/0x3350 fs/ext4/inode.c:2685
ext4_writepages+0x30c/0x780 fs/ext4/inode.c:2774
do_writepages+0x1b4/0x690 mm/page-writeback.c:2553
__writeback_single_inode+0x158/0xe90 fs/fs-writeback.c:1625
writeback_sb_inodes+0x599/0x1080 fs/fs-writeback.c:1916
wb_writeback+0x2a5/0xaa0 fs/fs-writeback.c:2092
wb_do_writeback fs/fs-writeback.c:2239 [inline]
wb_workfn+0x29c/0xfe0 fs/fs-writeback.c:2279
process_one_work+0x886/0x15d0 kernel/workqueue.c:2627
process_scheduled_works kernel/workqueue.c:2700 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2781
kthread+0x2c6/0x3a0 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
The buggy address belongs to the physical page:
page:ffffea0001cf0500 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x73c14
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000000 dead000000000100 dead000000000122 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 0x140dca(GFP_HIGHUSER_MOVABLE|__GFP_COMP|__GFP_ZERO), pid 5048, tgid 5048 (sshd), ts 46944198017, free_ts 47025991886
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2d0/0x350 mm/page_alloc.c:1537
prep_new_page mm/page_alloc.c:1544 [inline]
get_page_from_freelist+0xa25/0x36d0 mm/page_alloc.c:3312
__alloc_pages+0x22e/0x2420 mm/page_alloc.c:4568
alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133
vma_alloc_folio+0xad/0x220 mm/mempolicy.c:2172
do_anonymous_page mm/memory.c:4172 [inline]
do_pte_missing mm/memory.c:3729 [inline]
handle_pte_fault mm/memory.c:5039 [inline]
__handle_mm_fault+0xe07/0x3d70 mm/memory.c:5180
handle_mm_fault+0x47a/0xa10 mm/memory.c:5345
do_user_addr_fault+0x30b/0x1000 arch/x86/mm/fault.c:1364
handle_page_fault arch/x86/mm/fault.c:1505 [inline]
exc_page_fault+0x5d/0xc0 arch/x86/mm/fault.c:1561
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1137 [inline]
free_unref_page_prepare+0x4fa/0xaa0 mm/page_alloc.c:2347
free_unref_page_list+0xe6/0xb40 mm/page_alloc.c:2533
release_pages+0x32a/0x14f0 mm/swap.c:1042
tlb_batch_pages_flush+0x9a/0x190 mm/mmu_gather.c:98
tlb_flush_mmu_free mm/mmu_gather.c:293 [inline]
tlb_flush_mmu mm/mmu_gather.c:300 [inline]
tlb_finish_mmu+0x14b/0x6f0 mm/mmu_gather.c:392
unmap_region.constprop.0+0x2e6/0x3b0 mm/mmap.c:2341
do_vmi_align_munmap+0xde6/0x1600 mm/mmap.c:2657
do_vmi_munmap+0x20e/0x450 mm/mmap.c:2725
__vm_munmap+0x144/0x390 mm/mmap.c:3012
__do_sys_munmap mm/mmap.c:3029 [inline]
__se_sys_munmap mm/mmap.c:3026 [inline]
__x64_sys_munmap+0x62/0x80 mm/mmap.c:3026
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
Memory state around the buggy address:
ffff888073c14680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888073c14700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888073c14780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888073c14800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888073c14880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================