================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:841 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xae6/0xcc0 fs/ext4/extents.c:956 Read of size 4 at addr ffff888047aa0018 by task kworker/u4:15/2684 CPU: 0 UID: 0 PID: 2684 Comm: kworker/u4:15 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Workqueue: ext4-rsv-conversion ext4_end_io_rsv_work Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xba/0x230 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 ext4_ext_binsearch fs/ext4/extents.c:841 [inline] ext4_find_extent+0xae6/0xcc0 fs/ext4/extents.c:956 ext4_ext_map_blocks+0x29d/0x6b80 fs/ext4/extents.c:4208 ext4_map_create_blocks fs/ext4/inode.c:613 [inline] ext4_map_blocks+0x8da/0x1830 fs/ext4/inode.c:816 ext4_convert_unwritten_extents+0x2be/0x5f0 fs/ext4/extents.c:4976 ext4_convert_unwritten_io_end_vec+0xff/0x170 fs/ext4/extents.c:5016 ext4_end_io_end+0xc7/0x410 fs/ext4/page-io.c:199 ext4_do_flush_completed_IO fs/ext4/page-io.c:290 [inline] ext4_end_io_rsv_work+0x26a/0x340 fs/ext4/page-io.c:305 process_one_work kernel/workqueue.c:3257 [inline] process_scheduled_works+0xaec/0x17a0 kernel/workqueue.c:3340 worker_thread+0x89f/0xd90 kernel/workqueue.c:3421 kthread+0x726/0x8b0 kernel/kthread.c:463 ret_from_fork+0x51b/0xa40 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x563de0249 pfn:0x47aa0 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f0(buddy) raw: 04fff00000000000 ffffea00011e7208 ffffea00011e7108 0000000000000000 raw: 0000000563de0249 0000000000000001 00000000f0000000 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_ZERO|__GFP_COMP), pid 4735, tgid 4735 (udevd), ts 43738697826, free_ts 119802434350 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x228/0x280 mm/page_alloc.c:1884 prep_new_page mm/page_alloc.c:1892 [inline] get_page_from_freelist+0x24dc/0x2580 mm/page_alloc.c:3945 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5240 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2486 folio_alloc_mpol_noprof mm/mempolicy.c:2505 [inline] vma_alloc_folio_noprof+0xea/0x210 mm/mempolicy.c:2540 folio_prealloc+0x30/0x170 mm/memory.c:-1 alloc_anon_folio mm/memory.c:5168 [inline] do_anonymous_page mm/memory.c:5225 [inline] do_pte_missing+0x14e8/0x3310 mm/memory.c:4402 handle_pte_fault mm/memory.c:6276 [inline] __handle_mm_fault mm/memory.c:6414 [inline] handle_mm_fault+0x1b8c/0x32a0 mm/memory.c:6583 do_user_addr_fault+0xa73/0x1360 arch/x86/mm/fault.c:1334 handle_page_fault arch/x86/mm/fault.c:1474 [inline] exc_page_fault+0x6a/0xc0 arch/x86/mm/fault.c:1527 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:618 page last free pid 5386 tgid 5386 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1433 [inline] free_unref_folios+0xd9e/0x14d0 mm/page_alloc.c:3030 folios_put_refs+0x58a/0x680 mm/swap.c:1002 free_pages_and_swap_cache+0x2e7/0x5b0 mm/swap_state.c:355 __tlb_batch_free_encoded_pages mm/mmu_gather.c:137 [inline] tlb_batch_pages_flush mm/mmu_gather.c:150 [inline] tlb_flush_mmu_free mm/mmu_gather.c:398 [inline] tlb_flush_mmu+0x3a8/0x680 mm/mmu_gather.c:405 tlb_finish_mmu+0xf9/0x230 mm/mmu_gather.c:530 exit_mmap+0x451/0xb30 mm/mmap.c:1290 __mmput+0x118/0x430 kernel/fork.c:1173 exit_mm+0x168/0x220 kernel/exit.c:581 do_exit+0x62e/0x2310 kernel/exit.c:959 do_group_exit+0x21b/0x2d0 kernel/exit.c:1112 get_signal+0x1284/0x1330 kernel/signal.c:3034 arch_do_signal_or_restart+0xbc/0x830 arch/x86/kernel/signal.c:337 __exit_to_user_mode_loop kernel/entry/common.c:41 [inline] exit_to_user_mode_loop kernel/entry/common.c:75 [inline] __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline] irqentry_exit_to_user_mode_prepare include/linux/irq-entry-common.h:270 [inline] irqentry_exit_to_user_mode include/linux/irq-entry-common.h:339 [inline] irqentry_exit+0x176/0x620 kernel/entry/common.c:196 asm_exc_invalid_op+0x1a/0x20 arch/x86/include/asm/idtentry.h:616 Memory state around the buggy address: ffff888047a9ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888047a9ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888047aa0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888047aa0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888047aa0100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================