================================================================== BUG: KASAN: use-after-free in diWrite+0xde3/0x19b0 fs/jfs/jfs_imap.c:750 Write of size 32 at addr ffff888064ad6180 by task syz-executor/6908 CPU: 0 PID: 6908 Comm: syz-executor Not tainted 6.10.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 __asan_memcpy+0x40/0x70 mm/kasan/shadow.c:106 diWrite+0xde3/0x19b0 fs/jfs/jfs_imap.c:750 txCommit+0xa1a/0x6a20 fs/jfs/jfs_txnmgr.c:1255 add_missing_indices fs/jfs/jfs_dtree.c:2661 [inline] jfs_readdir+0x28e9/0x4660 fs/jfs/jfs_dtree.c:3009 wrap_directory_iterator+0x94/0xe0 fs/readdir.c:67 iterate_dir+0x57a/0x810 fs/readdir.c:110 __do_sys_getdents64 fs/readdir.c:409 [inline] __se_sys_getdents64+0x20d/0x4f0 fs/readdir.c:394 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fcc573a7c73 Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 d2 44 f8 ff 66 90 b8 ff ff ff 7f 48 39 c2 48 0f 47 d0 b8 d9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 c7 c2 a8 ff ff ff f7 d8 RSP: 002b:00007ffcea9457d8 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 000055555ef55600 RCX: 00007fcc573a7c73 RDX: 0000000000008000 RSI: 000055555ef55600 RDI: 0000000000000005 RBP: 000055555ef555d4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001000 R11: 0000000000000293 R12: ffffffffffffffa8 R13: 0000000000000010 R14: 000055555ef555d0 R15: 000000000000001e The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x64ad6 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffff7f(buddy) raw: 00fff00000000000 ffffea0000ba8cc8 ffffea00019a02c8 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x540dc0(GFP_USER|__GFP_COMP|__GFP_ZERO|__GFP_ACCOUNT), pid 7520, tgid 7519 (syz.4.235), ts 247965539542, free_ts 249035800135 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1473 prep_new_page mm/page_alloc.c:1481 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3425 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4683 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265 pagetable_alloc_noprof include/linux/mm.h:2908 [inline] __pte_alloc_one_noprof include/asm-generic/pgalloc.h:70 [inline] pte_alloc_one+0x88/0x5d0 arch/x86/mm/pgtable.c:33 __pte_alloc+0x79/0x3a0 mm/memory.c:442 do_anonymous_page mm/memory.c:4423 [inline] do_pte_missing mm/memory.c:3895 [inline] handle_pte_fault+0x5531/0x7090 mm/memory.c:5381 __handle_mm_fault mm/memory.c:5524 [inline] handle_mm_fault+0xfb0/0x19d0 mm/memory.c:5689 do_user_addr_fault arch/x86/mm/fault.c:1338 [inline] handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x459/0x8c0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 page last free pid 7520 tgid 7519 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1093 [inline] free_unref_folios+0xf12/0x19c0 mm/page_alloc.c:2637 folios_put_refs+0x93a/0xa60 mm/swap.c:1024 free_pages_and_swap_cache+0x5c8/0x690 mm/swap_state.c:332 __tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline] tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:366 [inline] tlb_flush_mmu+0x3a3/0x680 mm/mmu_gather.c:373 tlb_finish_mmu+0xd4/0x200 mm/mmu_gather.c:465 unmap_region+0x2df/0x350 mm/mmap.c:2370 do_vmi_align_munmap+0x1122/0x18c0 mm/mmap.c:2683 do_vmi_munmap+0x261/0x2f0 mm/mmap.c:2759 __vm_munmap+0x1fc/0x400 mm/mmap.c:3038 __do_sys_munmap mm/mmap.c:3055 [inline] __se_sys_munmap mm/mmap.c:3052 [inline] __x64_sys_munmap+0x68/0x80 mm/mmap.c:3052 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888064ad6080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888064ad6100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888064ad6180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888064ad6200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888064ad6280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================