================================================================== BUG: KASAN: slab-use-after-free in dtMoveEntry fs/jfs/jfs_dtree.c:3934 [inline] BUG: KASAN: slab-use-after-free in dtSplitPage+0x1e37/0x3b20 fs/jfs/jfs_dtree.c:1561 Write of size 1 at addr ffff888042212000 by task syz.0.0/5323 CPU: 0 UID: 0 PID: 5323 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 dtMoveEntry fs/jfs/jfs_dtree.c:3934 [inline] dtSplitPage+0x1e37/0x3b20 fs/jfs/jfs_dtree.c:1561 dtSplitUp fs/jfs/jfs_dtree.c:1092 [inline] dtInsert+0x109b/0x5f40 fs/jfs/jfs_dtree.c:871 jfs_rename+0x7bc/0x1610 fs/jfs/namei.c:1225 vfs_rename+0xb34/0xe80 fs/namei.c:5216 do_renameat2+0x6a2/0xa50 fs/namei.c:5364 __do_sys_rename fs/namei.c:5411 [inline] __se_sys_rename fs/namei.c:5409 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5409 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f238df8f6c9 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:00007f238ed82038 EFLAGS: 00000246 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 00007f238e1e5fa0 RCX: 00007f238df8f6c9 RDX: 0000000000000000 RSI: 0000200000000f40 RDI: 0000200000000300 RBP: 00007f238e011f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f238e1e6038 R14: 00007f238e1e5fa0 R15: 00007ffc9706b3c8 Allocated by task 5281: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 unpoison_slab_object mm/kasan/common.c:342 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:368 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4978 [inline] kmem_cache_alloc_from_sheaf_noprof+0x9c/0x160 mm/slub.c:5563 mas_pop_node lib/maple_tree.c:1086 [inline] mas_new_ma_node lib/maple_tree.c:2140 [inline] mas_split_final_node+0x1a9/0x580 lib/maple_tree.c:2816 mas_split lib/maple_tree.c:3012 [inline] mas_commit_b_node+0xb90/0x1090 lib/maple_tree.c:3072 mas_wr_bnode lib/maple_tree.c:3739 [inline] mas_wr_store_entry+0x522/0x27b0 lib/maple_tree.c:3771 mas_store_prealloc+0xaf2/0x1030 lib/maple_tree.c:5169 vma_iter_store_new mm/vma.h:488 [inline] __mmap_new_vma mm/vma.c:2497 [inline] __mmap_region mm/vma.c:2670 [inline] mmap_region+0x1b64/0x2110 mm/vma.c:2740 do_mmap+0xc45/0x10d0 mm/mmap.c:558 vm_mmap_pgoff+0x2a6/0x4d0 mm/util.c:581 ksys_mmap_pgoff+0x51f/0x760 mm/mmap.c:604 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 1042: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 __kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:587 kasan_save_free_info mm/kasan/kasan.h:406 [inline] poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2543 [inline] slab_free_freelist_hook mm/slub.c:2572 [inline] slab_free_bulk mm/slub.c:6670 [inline] kmem_cache_free_bulk+0xb0c/0xdb0 mm/slub.c:7354 kfree_bulk include/linux/slab.h:830 [inline] kvfree_rcu_bulk+0xe5/0x1f0 mm/slab_common.c:1522 kvfree_rcu_drain_ready mm/slab_common.c:1729 [inline] kfree_rcu_monitor+0x211/0x2a0 mm/slab_common.c:1802 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:56 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:559 kvfree_call_rcu+0x130/0x4c0 mm/slab_common.c:1995 ma_free_rcu lib/maple_tree.c:208 [inline] mas_topiary_node lib/maple_tree.c:2311 [inline] mas_topiary_replace lib/maple_tree.c:2410 [inline] mas_wmb_replace+0x10d8/0x1820 lib/maple_tree.c:2433 mas_split lib/maple_tree.c:3052 [inline] mas_commit_b_node+0xbf7/0x1090 lib/maple_tree.c:3072 mas_wr_bnode lib/maple_tree.c:3739 [inline] mas_wr_store_entry+0x522/0x27b0 lib/maple_tree.c:3771 mas_store_prealloc+0xaf2/0x1030 lib/maple_tree.c:5169 vma_iter_store_new mm/vma.h:488 [inline] vma_complete+0x224/0xae0 mm/vma.c:354 __split_vma+0x8a6/0xa00 mm/vma.c:568 vms_gather_munmap_vmas+0x4c6/0x12e0 mm/vma.c:1380 __mmap_prepare mm/vma.c:2359 [inline] __mmap_region mm/vma.c:2652 [inline] mmap_region+0x722/0x2110 mm/vma.c:2740 do_mmap+0xc45/0x10d0 mm/mmap.c:558 vm_mmap_pgoff+0x2a6/0x4d0 mm/util.c:581 ksys_mmap_pgoff+0x51f/0x760 mm/mmap.c:604 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888042212000 which belongs to the cache maple_node of size 256 The buggy address is located 0 bytes inside of freed 256-byte region [ffff888042212000, ffff888042212100) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888042212800 pfn:0x42212 flags: 0x4fff00000000200(workingset|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000200 ffff88801a04bc80 ffffea00010a1ad0 ffffea000108b8d0 raw: ffff888042212800 0000000000080002 00000000f5000000 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 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 4753, tgid 4753 (v4l_id), ts 31010325073, free_ts 31005688386 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3059 [inline] allocate_slab+0x96/0x350 mm/slub.c:3232 new_slab mm/slub.c:3286 [inline] ___slab_alloc+0xf56/0x1990 mm/slub.c:4655 __kmem_cache_alloc_bulk+0x1e2/0x590 mm/slub.c:7402 refill_sheaf mm/slub.c:2637 [inline] __pcs_replace_empty_main+0x292/0x540 mm/slub.c:5048 alloc_from_pcs mm/slub.c:5146 [inline] slab_alloc_node mm/slub.c:5273 [inline] kmem_cache_alloc_noprof+0x453/0x6e0 mm/slub.c:5295 mt_alloc_one lib/maple_tree.c:174 [inline] mas_alloc_nodes+0x291/0x350 lib/maple_tree.c:1110 mas_preallocate+0x2e0/0x670 lib/maple_tree.c:5194 vma_iter_prealloc mm/vma.h:442 [inline] vma_link+0xfd/0x440 mm/vma.c:1792 insert_vm_struct+0x199/0x260 mm/vma.c:3197 __install_special_mapping mm/mmap.c:1461 [inline] _install_special_mapping+0x1b0/0x350 mm/mmap.c:1497 map_vdso+0x1df/0x480 arch/x86/entry/vdso/vma.c:159 load_elf_binary+0x1c25/0x2740 fs/binfmt_elf.c:1291 page last free pid 15 tgid 15 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2906 __tlb_remove_table_free mm/mmu_gather.c:227 [inline] tlb_remove_table_rcu+0x85/0x100 mm/mmu_gather.c:290 rcu_do_batch kernel/rcu/tree.c:2605 [inline] rcu_core+0xcab/0x1770 kernel/rcu/tree.c:2861 handle_softirqs+0x286/0x870 kernel/softirq.c:622 run_ksoftirqd+0x9b/0x100 kernel/softirq.c:1063 smpboot_thread_fn+0x542/0xa60 kernel/smpboot.c:160 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888042211f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888042211f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888042212000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888042212080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888042212100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================