loop0: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: use-after-free in diWrite+0xbe7/0x1610 fs/jfs/jfs_imap.c:753 Write of size 32 at addr ffff88802a2810c0 by task syz.0.16/5116 CPU: 1 PID: 5116 Comm: syz.0.16 Not tainted 5.15.189-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 print_address_description+0x60/0x2d0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xdf/0x130 mm/kasan/report.c:451 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x27b/0x290 mm/kasan/generic.c:189 memcpy+0x3c/0x60 mm/kasan/shadow.c:66 diWrite+0xbe7/0x1610 fs/jfs/jfs_imap.c:753 txCommit+0x84b/0x51c0 fs/jfs/jfs_txnmgr.c:1255 add_missing_indices+0x85f/0xc30 fs/jfs/jfs_dtree.c:2972 jfs_readdir+0x1e43/0x3c10 fs/jfs/jfs_dtree.c:3329 iterate_dir+0x218/0x560 fs/readdir.c:-1 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0xe5/0x260 fs/readdir.c:354 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:0x7fed2b7f4d29 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:00007fed2aa6d038 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007fed2b9e4fa0 RCX: 00007fed2b7f4d29 RDX: 000000000000009e RSI: 0000000020000280 RDI: 0000000000000004 RBP: 00007fed2b870b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fed2b9e4fa0 R15: 00007ffcdc919148 Allocated by task 4930: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0x9c/0xd0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0x100/0x290 mm/slub.c:3233 ptlock_alloc+0x1c/0x60 mm/memory.c:5556 ptlock_init include/linux/mm.h:2230 [inline] pgtable_pte_page_ctor include/linux/mm.h:2257 [inline] __pte_alloc_one include/asm-generic/pgalloc.h:66 [inline] pte_alloc_one+0xc5/0x2f0 arch/x86/mm/pgtable.c:33 __pte_alloc+0x21/0x150 mm/memory.c:439 copy_pte_range mm/memory.c:1032 [inline] copy_pmd_range mm/memory.c:1167 [inline] copy_pud_range mm/memory.c:1204 [inline] copy_p4d_range mm/memory.c:1228 [inline] copy_page_range+0x29b8/0x3220 mm/memory.c:1301 dup_mmap kernel/fork.c:615 [inline] dup_mm kernel/fork.c:1466 [inline] copy_mm+0xc5e/0x1370 kernel/fork.c:1518 copy_process+0x17c6/0x3e00 kernel/fork.c:2290 kernel_clone+0x219/0x930 kernel/fork.c:2679 __do_sys_clone kernel/fork.c:2796 [inline] __se_sys_clone kernel/fork.c:2780 [inline] __x64_sys_clone+0x170/0x1c0 kernel/fork.c:2780 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 Freed by task 4931: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xea/0x170 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kmem_cache_free+0x8f/0x210 mm/slub.c:3515 pgtable_pte_page_dtor include/linux/mm.h:2266 [inline] ___pte_free_tlb+0x88/0x2a0 arch/x86/mm/pgtable.c:55 __pte_free_tlb arch/x86/include/asm/pgalloc.h:61 [inline] free_pte_range mm/memory.c:231 [inline] free_pmd_range mm/memory.c:249 [inline] free_pud_range mm/memory.c:283 [inline] free_p4d_range mm/memory.c:317 [inline] free_pgd_range+0x622/0xb00 mm/memory.c:397 free_pgtables+0x271/0x2a0 mm/memory.c:-1 exit_mmap+0x39e/0x5f0 mm/mmap.c:3213 __mmput+0x115/0x3b0 kernel/fork.c:1127 exec_mmap+0x4d1/0x5c0 fs/exec.c:1035 begin_new_exec+0x7e8/0x1160 fs/exec.c:1293 load_elf_binary+0x98e/0x2890 fs/binfmt_elf.c:1001 search_binary_handler fs/exec.c:1742 [inline] exec_binprm fs/exec.c:1783 [inline] bprm_execve+0xa92/0x17d0 fs/exec.c:1852 do_execveat_common+0x51e/0x6d0 fs/exec.c:1957 do_execve fs/exec.c:2027 [inline] __do_sys_execve fs/exec.c:2103 [inline] __se_sys_execve fs/exec.c:2098 [inline] __x64_sys_execve+0x8e/0xa0 fs/exec.c:2098 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 The buggy address belongs to the object at ffff88802a2810c0 which belongs to the cache page->ptl of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff88802a2810c0, ffff88802a281100) The buggy address belongs to the page: page:ffffea0000a8a040 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2a281 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000a64b80 0000001a0000001a ffff88801684f780 raw: 0000000000000000 00000000002a002a 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 4112, ts 40387060298, free_ts 40382767366 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5474 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xc0/0x4b0 mm/slub.c:1975 ___slab_alloc+0x81e/0xdf0 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0x195/0x290 mm/slub.c:3233 ptlock_alloc+0x1c/0x60 mm/memory.c:5556 ptlock_init include/linux/mm.h:2230 [inline] pgtable_pte_page_ctor include/linux/mm.h:2257 [inline] __pte_alloc_one include/asm-generic/pgalloc.h:66 [inline] pte_alloc_one+0xc5/0x2f0 arch/x86/mm/pgtable.c:33 __pte_alloc+0x21/0x150 mm/memory.c:439 copy_pte_range mm/memory.c:1032 [inline] copy_pmd_range mm/memory.c:1167 [inline] copy_pud_range mm/memory.c:1204 [inline] copy_p4d_range mm/memory.c:1228 [inline] copy_page_range+0x29b8/0x3220 mm/memory.c:1301 dup_mmap kernel/fork.c:615 [inline] dup_mm kernel/fork.c:1466 [inline] copy_mm+0xc5e/0x1370 kernel/fork.c:1518 copy_process+0x17c6/0x3e00 kernel/fork.c:2290 kernel_clone+0x219/0x930 kernel/fork.c:2679 __do_sys_clone kernel/fork.c:2796 [inline] __se_sys_clone kernel/fork.c:2780 [inline] __x64_sys_clone+0x170/0x1c0 kernel/fork.c:2780 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 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317 free_unref_page+0x94/0x280 mm/page_alloc.c:3396 tlb_batch_list_free mm/mmu_gather.c:61 [inline] tlb_finish_mmu+0x236/0x2e0 mm/mmu_gather.c:341 exit_mmap+0x3a6/0x5f0 mm/mmap.c:3214 __mmput+0x115/0x3b0 kernel/fork.c:1127 exit_mm+0x567/0x6c0 kernel/exit.c:550 do_exit+0x5a1/0x20a0 kernel/exit.c:870 do_group_exit+0x12e/0x300 kernel/exit.c:997 __do_sys_exit_group kernel/exit.c:1008 [inline] __se_sys_exit_group kernel/exit.c:1006 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1006 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: ffff88802a280f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802a281000: fa fb fb fb fb fb fb fb fc fc fc fc fa fb fb fb >ffff88802a281080: fb fb fb fb fc fc fc fc fa fb fb fb fb fb fb fb ^ ffff88802a281100: fc fc fc fc fa fb fb fb fb fb fb fb fc fc fc fc ffff88802a281180: fa fb fb fb fb fb fb fb fc fc fc fc fa fb fb fb ==================================================================