loop0: detected capacity change from 0 to 32768 find_entry called with index >= next_index ================================================================== BUG: KASAN: slab-out-of-bounds in diWrite+0xde3/0x19b0 fs/jfs/jfs_imap.c:750 Write of size 32 at addr ffff888077428180 by task syz-executor145/5083 CPU: 0 PID: 5083 Comm: syz-executor145 Not tainted 6.10.0-syzkaller-10729-g3c3ff7be9729 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/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:65 iterate_dir+0x57a/0x810 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:407 [inline] __se_sys_getdents64+0x20d/0x4f0 fs/readdir.c:392 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:0x7fdead60a289 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 17 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffd6acb0138 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fdead60a289 RDX: 0000000000001000 RSI: 0000000020000840 RDI: 0000000000000005 RBP: 0000000000000000 R08: 00007ffd6acb0190 R09: 00007ffd6acb0190 R10: 00007ffd6acb0190 R11: 0000000000000246 R12: 00007ffd6acb0190 R13: 00007ffd6acb0270 R14: 431bde82d7b634db R15: 00007fdead65301d Allocated by task 5076: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3979 [inline] kmem_cache_alloc_bulk_noprof+0x4cd/0x770 mm/slub.c:4830 mt_alloc_bulk lib/maple_tree.c:167 [inline] mas_alloc_nodes+0x3d5/0x840 lib/maple_tree.c:1264 mas_node_count_gfp lib/maple_tree.c:1322 [inline] mas_preallocate+0xfca/0x1730 lib/maple_tree.c:5556 vma_iter_prealloc mm/internal.h:1360 [inline] __split_vma+0x2e5/0xc30 mm/mmap.c:2407 split_vma mm/mmap.c:2466 [inline] vma_modify+0x268/0x350 mm/mmap.c:2507 vma_modify_flags include/linux/mm.h:3352 [inline] mprotect_fixup+0x3ea/0xa90 mm/mprotect.c:637 do_mprotect_pkey+0x908/0xe00 mm/mprotect.c:820 __do_sys_mprotect mm/mprotect.c:841 [inline] __se_sys_mprotect mm/mprotect.c:838 [inline] __x64_sys_mprotect+0x80/0x90 mm/mprotect.c:838 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 Freed by task 0: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2235 [inline] slab_free mm/slub.c:4464 [inline] kmem_cache_free+0x145/0x350 mm/slub.c:4539 rcu_do_batch kernel/rcu/tree.c:2569 [inline] rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2843 handle_softirqs+0x2c4/0x970 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637 irq_exit_rcu+0x9/0x30 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:541 __call_rcu_common kernel/rcu/tree.c:3106 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:3210 ma_free_rcu lib/maple_tree.c:197 [inline] mas_topiary_node lib/maple_tree.c:2524 [inline] mas_topiary_replace lib/maple_tree.c:2624 [inline] mas_wmb_replace+0x143a/0x2810 lib/maple_tree.c:2646 mas_split lib/maple_tree.c:3393 [inline] mas_commit_b_node+0x13b2/0x2440 lib/maple_tree.c:3446 mas_wr_bnode lib/maple_tree.c:4158 [inline] mas_wr_modify+0x72e/0x2830 lib/maple_tree.c:4196 mas_store_prealloc+0x278/0x5f0 lib/maple_tree.c:5485 vma_complete+0x21d/0xb60 mm/mmap.c:535 __split_vma+0xaca/0xc30 mm/mmap.c:2440 split_vma mm/mmap.c:2466 [inline] vma_modify+0x268/0x350 mm/mmap.c:2507 vma_modify_flags include/linux/mm.h:3352 [inline] mprotect_fixup+0x3ea/0xa90 mm/mprotect.c:637 do_mprotect_pkey+0x908/0xe00 mm/mprotect.c:820 __do_sys_mprotect mm/mprotect.c:841 [inline] __se_sys_mprotect mm/mprotect.c:838 [inline] __x64_sys_mprotect+0x80/0x90 mm/mprotect.c:838 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 The buggy address belongs to the object at ffff888077428000 which belongs to the cache maple_node of size 256 The buggy address is located 128 bytes to the right of allocated 256-byte region [ffff888077428000, ffff888077428100) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x77428 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000040 ffff888015091000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000100010 00000001ffffefff 0000000000000000 head: 00fff00000000040 ffff888015091000 dead000000000122 0000000000000000 head: 0000000000000000 0000000000100010 00000001ffffefff 0000000000000000 head: 00fff00000000001 ffffea0001dd0a01 ffffffffffffffff 0000000000000000 head: 0000000000000002 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5076, tgid 5076 (sshd), ts 51766055028, free_ts 49226447608 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_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2304 allocate_slab+0x5a/0x2f0 mm/slub.c:2467 new_slab mm/slub.c:2520 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3706 __kmem_cache_alloc_bulk mm/slub.c:4750 [inline] kmem_cache_alloc_bulk_noprof+0x202/0x770 mm/slub.c:4822 mt_alloc_bulk lib/maple_tree.c:167 [inline] mas_alloc_nodes+0x3d5/0x840 lib/maple_tree.c:1264 mas_node_count_gfp lib/maple_tree.c:1322 [inline] mas_preallocate+0xfca/0x1730 lib/maple_tree.c:5556 vma_iter_prealloc mm/internal.h:1360 [inline] __split_vma+0x2e5/0xc30 mm/mmap.c:2407 split_vma mm/mmap.c:2466 [inline] vma_modify+0x268/0x350 mm/mmap.c:2507 vma_modify_flags include/linux/mm.h:3352 [inline] mprotect_fixup+0x3ea/0xa90 mm/mprotect.c:637 do_mprotect_pkey+0x908/0xe00 mm/mprotect.c:820 __do_sys_mprotect mm/mprotect.c:841 [inline] __se_sys_mprotect mm/mprotect.c:838 [inline] __x64_sys_mprotect+0x80/0x90 mm/mprotect.c:838 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 page last free pid 4940 tgid 4940 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1093 [inline] free_unref_page+0xd19/0xea0 mm/page_alloc.c:2588 __folio_put+0x3b9/0x620 mm/swap.c:129 pipe_buf_release include/linux/pipe_fs_i.h:219 [inline] pipe_update_tail fs/pipe.c:224 [inline] pipe_read+0x6f2/0x13e0 fs/pipe.c:344 new_sync_read fs/read_write.c:395 [inline] vfs_read+0x9bd/0xbc0 fs/read_write.c:476 ksys_read+0x1a0/0x2c0 fs/read_write.c:619 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: ffff888077428080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888077428100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888077428180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888077428200: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888077428280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================