================================================================== BUG: KASAN: slab-out-of-bounds in ocfs2_replay_truncate_records fs/ocfs2/alloc.c:5967 [inline] BUG: KASAN: slab-out-of-bounds in __ocfs2_flush_truncate_log+0x7c7/0x10e0 fs/ocfs2/alloc.c:6062 Read of size 4 at addr ffff888049838150 by task syz-executor/5721 CPU: 0 UID: 0 PID: 5721 Comm: syz-executor 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 ocfs2_replay_truncate_records fs/ocfs2/alloc.c:5967 [inline] __ocfs2_flush_truncate_log+0x7c7/0x10e0 fs/ocfs2/alloc.c:6062 ocfs2_flush_truncate_log+0x4f/0x70 fs/ocfs2/alloc.c:6084 ocfs2_sync_fs+0x116/0x310 fs/ocfs2/super.c:406 sync_filesystem+0x1cf/0x230 fs/sync.c:66 generic_shutdown_super+0x6f/0x2c0 fs/super.c:621 kill_block_super+0x44/0x90 fs/super.c:1722 deactivate_locked_super+0xbc/0x130 fs/super.c:473 cleanup_mnt+0x425/0x4c0 fs/namespace.c:1327 task_work_run+0x1d4/0x260 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop+0xe9/0x130 kernel/entry/common.c:43 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline] do_syscall_64+0x2bd/0xfa0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fa319f8fed7 Code: a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007fffe37f7b58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 00007fa31a011c05 RCX: 00007fa319f8fed7 RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007fffe37f7c10 RBP: 00007fffe37f7c10 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffffff R11: 0000000000000246 R12: 00007fffe37f8ca0 R13: 00007fa31a011c05 R14: 00000000000282d9 R15: 00007fffe37f8ce0 Allocated by task 5973: 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:4955 [inline] slab_alloc_node mm/slub.c:5265 [inline] kmem_cache_alloc_noprof+0x367/0x6e0 mm/slub.c:5272 mt_alloc_one lib/maple_tree.c:172 [inline] mas_alloc_nodes+0x291/0x350 lib/maple_tree.c:1108 mas_preallocate+0x2e0/0x670 lib/maple_tree.c:5192 vma_iter_prealloc mm/vma.h:442 [inline] __split_vma+0x2fa/0xa00 mm/vma.c:528 vms_gather_munmap_vmas+0x2e2/0x12e0 mm/vma.c:1359 __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 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:206 [inline] mas_free lib/maple_tree.c:1172 [inline] mas_replace_node lib/maple_tree.c:1579 [inline] mas_wr_node_store lib/maple_tree.c:3551 [inline] mas_wr_store_entry+0x18b0/0x2790 lib/maple_tree.c:3762 mas_store_prealloc+0xaf2/0x1030 lib/maple_tree.c:5167 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 The buggy address belongs to the object at ffff888049838000 which belongs to the cache maple_node of size 256 The buggy address is located 80 bytes to the right of allocated 256-byte region [ffff888049838000, ffff888049838100) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x49838 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000000 ffff88801a44bc80 dead000000000122 0000000000000000 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 5974, tgid 5974 (modprobe), ts 164845444076, free_ts 164839015456 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:3039 [inline] allocate_slab+0x96/0x3a0 mm/slub.c:3212 new_slab mm/slub.c:3266 [inline] ___slab_alloc+0xe94/0x18a0 mm/slub.c:4636 __kmem_cache_alloc_bulk+0x1e2/0x590 mm/slub.c:7375 refill_sheaf mm/slub.c:2617 [inline] kmem_cache_prefill_sheaf+0x295/0x450 mm/slub.c:5396 mt_get_sheaf lib/maple_tree.c:187 [inline] mas_alloc_nodes+0x1c2/0x350 lib/maple_tree.c:1138 mas_preallocate+0x2e0/0x670 lib/maple_tree.c:5192 vma_iter_prealloc mm/vma.h:442 [inline] __split_vma+0x2fa/0xa00 mm/vma.c:528 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 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: ffff888049838000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888049838080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888049838100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888049838180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888049838200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================