loop0: detected capacity change from 0 to 32768 loop0: detected capacity change from 32768 to 0 syz.0.0: attempt to access beyond end of device loop0: rw=2049, sector=30760, nr_sectors = 8 limit=0 lbmIODone: I/O error in JFS log ================================================================== 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 ffff8880436a2000 by task syz.0.0/5353 CPU: 0 UID: 0 PID: 5353 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+0xbd7/0xf00 fs/namei.c:5129 do_renameat2+0x6ce/0xa80 fs/namei.c:5278 __do_sys_rename fs/namei.c:5325 [inline] __se_sys_rename fs/namei.c:5323 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5323 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f8b7198ebe9 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:00007f8b6ddf5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 00007f8b71bb5fa0 RCX: 00007f8b7198ebe9 RDX: 0000000000000000 RSI: 0000200000000f40 RDI: 0000200000000300 RBP: 00007f8b71a11e19 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f8b71bb6038 R14: 00007f8b71bb5fa0 R15: 00007ffc6c9cacc8 Allocated by task 5348: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:330 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:356 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4180 [inline] kmem_cache_alloc_bulk_noprof+0x4e0/0x790 mm/slub.c:5411 mt_alloc_bulk lib/maple_tree.c:181 [inline] mas_alloc_nodes+0x447/0x8e0 lib/maple_tree.c:1277 mas_node_count_gfp lib/maple_tree.c:1337 [inline] mas_preallocate+0x3ad/0x6f0 lib/maple_tree.c:5537 vma_iter_prealloc mm/vma.h:462 [inline] __mmap_new_vma mm/vma.c:2470 [inline] __mmap_region mm/vma.c:2669 [inline] mmap_region+0xf1e/0x20c0 mm/vma.c:2739 do_mmap+0xc45/0x10d0 mm/mmap.c:558 vm_mmap_pgoff+0x2a6/0x4d0 mm/util.c:580 ksys_mmap_pgoff+0x51f/0x760 mm/mmap.c:604 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 15: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:243 [inline] __kasan_slab_free+0x5b/0x80 mm/kasan/common.c:275 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2417 [inline] slab_free mm/slub.c:4680 [inline] kmem_cache_free+0x18f/0x400 mm/slub.c:4782 rcu_do_batch kernel/rcu/tree.c:2605 [inline] rcu_core+0xca8/0x1770 kernel/rcu/tree.c:2861 handle_softirqs+0x283/0x870 kernel/softirq.c:579 run_ksoftirqd+0x9b/0x100 kernel/softirq.c:968 smpboot_thread_fn+0x53f/0xa60 kernel/smpboot.c:160 kthread+0x70e/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 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:47 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:548 __call_rcu_common kernel/rcu/tree.c:3123 [inline] call_rcu+0x157/0x9c0 kernel/rcu/tree.c:3243 ma_free_rcu lib/maple_tree.c:211 [inline] mas_topiary_node lib/maple_tree.c:2527 [inline] mas_topiary_replace lib/maple_tree.c:2634 [inline] mas_wmb_replace+0x1756/0x25f0 lib/maple_tree.c:2651 mas_split lib/maple_tree.c:3390 [inline] mas_commit_b_node+0xabf/0xf70 lib/maple_tree.c:3410 mas_wr_bnode lib/maple_tree.c:4079 [inline] mas_wr_store_entry+0x50f/0x25b0 lib/maple_tree.c:4111 mas_store_prealloc+0xb00/0xf60 lib/maple_tree.c:5510 vma_iter_store_new mm/vma.h:508 [inline] __mmap_new_vma mm/vma.c:2497 [inline] __mmap_region mm/vma.c:2669 [inline] mmap_region+0x1b5e/0x20c0 mm/vma.c:2739 do_mmap+0xc45/0x10d0 mm/mmap.c:558 vm_mmap_pgoff+0x2a6/0x4d0 mm/util.c:580 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8880436a2000 which belongs to the cache maple_node of size 256 The buggy address is located 0 bytes inside of freed 256-byte region [ffff8880436a2000, ffff8880436a2100) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x436a2 anon flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000000 ffff88801a4c0000 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000080008 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 5045, tgid 5045 (dhcpcd), ts 36303220696, free_ts 34751717119 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2487 [inline] allocate_slab+0x8a/0x370 mm/slub.c:2655 new_slab mm/slub.c:2709 [inline] ___slab_alloc+0xbeb/0x1410 mm/slub.c:3891 __slab_alloc mm/slub.c:3981 [inline] __slab_alloc_node mm/slub.c:4056 [inline] slab_alloc_node mm/slub.c:4217 [inline] kmem_cache_alloc_noprof+0x283/0x3c0 mm/slub.c:4236 mt_alloc_one lib/maple_tree.c:176 [inline] mas_alloc_nodes+0x2e9/0x8e0 lib/maple_tree.c:1255 mas_node_count_gfp lib/maple_tree.c:1337 [inline] mas_preallocate+0x3ad/0x6f0 lib/maple_tree.c:5537 vma_iter_prealloc mm/vma.h:462 [inline] __split_vma+0x2fa/0xa00 mm/vma.c:528 vms_gather_munmap_vmas+0x2ea/0x12f0 mm/vma.c:1359 __mmap_prepare mm/vma.c:2359 [inline] __mmap_region mm/vma.c:2651 [inline] mmap_region+0x724/0x20c0 mm/vma.c:2739 do_mmap+0xc45/0x10d0 mm/mmap.c:558 vm_mmap_pgoff+0x2a6/0x4d0 mm/util.c:580 ksys_mmap_pgoff+0x51f/0x760 mm/mmap.c:604 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 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:1395 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2895 pagetable_free include/linux/mm.h:2898 [inline] pagetable_dtor_free include/linux/mm.h:2996 [inline] __tlb_remove_table+0x2d2/0x3b0 include/asm-generic/tlb.h:220 __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+0xca8/0x1770 kernel/rcu/tree.c:2861 handle_softirqs+0x283/0x870 kernel/softirq.c:579 run_ksoftirqd+0x9b/0x100 kernel/softirq.c:968 smpboot_thread_fn+0x53f/0xa60 kernel/smpboot.c:160 kthread+0x70e/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff8880436a1f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880436a1f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880436a2000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880436a2080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880436a2100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================