loop0: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: use-after-free in diWrite+0xddb/0x19b0 fs/jfs/jfs_imap.c:753 Write of size 32 at addr ffff888079e4b0c0 by task syz.0.16/5004 CPU: 1 PID: 5004 Comm: syz.0.16 Not tainted 5.15.176-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 kasan_check_range+0x27e/0x290 mm/kasan/generic.c:189 memcpy+0x3c/0x60 mm/kasan/shadow.c:66 diWrite+0xddb/0x19b0 fs/jfs/jfs_imap.c:753 txCommit+0xa13/0x6ba0 fs/jfs/jfs_txnmgr.c:1255 add_missing_indices+0x8af/0xbf0 fs/jfs/jfs_dtree.c:2959 jfs_readdir+0x2008/0x3bc0 fs/jfs/jfs_dtree.c:3315 iterate_dir+0x224/0x570 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0x209/0x4f0 fs/readdir.c:354 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f3a08411d29 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:00007f3a0768a038 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 00007f3a08601fa0 RCX: 00007f3a08411d29 RDX: 000000000000009e RSI: 0000000020000280 RDI: 0000000000000004 RBP: 00007f3a0848db08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f3a08601fa0 R15: 00007ffc9a3dfb88 Allocated by task 4808: 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+0x8e/0xc0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233 vm_area_dup+0x1e/0xb0 kernel/fork.c:358 __split_vma+0xb4/0x420 mm/mmap.c:2718 __do_munmap+0x38e/0x1710 mm/mmap.c:2844 do_munmap mm/mmap.c:2898 [inline] munmap_vma_range mm/mmap.c:602 [inline] __mmap_region mm/mmap.c:1745 [inline] mmap_region+0x9f9/0x1870 mm/mmap.c:2921 do_mmap+0x78d/0xe00 mm/mmap.c:1574 vm_mmap_pgoff+0x1ca/0x2d0 mm/util.c:551 ksys_mmap_pgoff+0x559/0x780 mm/mmap.c:1623 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 4808: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd8/0x120 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+0xdd/0x160 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kmem_cache_free+0x91/0x1f0 mm/slub.c:3515 remove_vma mm/mmap.c:187 [inline] remove_vma_list mm/mmap.c:2616 [inline] __do_munmap+0x15b5/0x1710 mm/mmap.c:2890 do_munmap mm/mmap.c:2898 [inline] munmap_vma_range mm/mmap.c:602 [inline] __mmap_region mm/mmap.c:1745 [inline] mmap_region+0x9f9/0x1870 mm/mmap.c:2921 do_mmap+0x78d/0xe00 mm/mmap.c:1574 vm_mmap_pgoff+0x1ca/0x2d0 mm/util.c:551 ksys_mmap_pgoff+0x13e/0x780 mm/mmap.c:1623 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff888079e4b000 which belongs to the cache vm_area_struct of size 200 The buggy address is located 192 bytes inside of 200-byte region [ffff888079e4b000, ffff888079e4b0c8) The buggy address belongs to the page: page:ffffea0001e792c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x79e4b memcg:ffff88805d257801 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea00018496c0 0000000c0000000c ffff8880175e9a00 raw: 0000000000000000 00000000000f000f 00000001ffffffff ffff88805d257801 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 3837, ts 99760085139, free_ts 99754227149 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x3b78/0x3d40 mm/page_alloc.c:4192 __alloc_pages+0x272/0x700 mm/page_alloc.c:5465 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 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+0x18e/0x280 mm/slub.c:3233 vm_area_dup kernel/fork.c:358 [inline] dup_mmap kernel/fork.c:557 [inline] dup_mm kernel/fork.c:1466 [inline] copy_mm+0x8d2/0x1370 kernel/fork.c:1518 copy_process+0x1816/0x3ef0 kernel/fork.c:2205 kernel_clone+0x210/0x960 kernel/fork.c:2603 __do_sys_clone kernel/fork.c:2720 [inline] __se_sys_clone kernel/fork.c:2704 [inline] __x64_sys_clone+0x23f/0x290 kernel/fork.c:2704 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 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+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page_list+0x1f7/0x8e0 mm/page_alloc.c:3433 release_pages+0x1bb9/0x1f40 mm/swap.c:963 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu mm/mmu_gather.c:247 [inline] tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:338 exit_mmap+0x3cd/0x620 mm/mmap.c:3206 __mmput+0x112/0x3b0 kernel/fork.c:1127 exit_mm+0x688/0x7f0 kernel/exit.c:550 do_exit+0x626/0x2480 kernel/exit.c:861 do_group_exit+0x144/0x310 kernel/exit.c:996 __do_sys_exit_group kernel/exit.c:1007 [inline] __se_sys_exit_group kernel/exit.c:1005 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1005 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Memory state around the buggy address: ffff888079e4af80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888079e4b000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888079e4b080: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ^ ffff888079e4b100: fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888079e4b180: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc ==================================================================