================================================================== BUG: KASAN: slab-out-of-bounds in ocfs2_check_dir_entry fs/ocfs2/dir.c:305 [inline] BUG: KASAN: slab-out-of-bounds in ocfs2_dir_foreach_blk_id fs/ocfs2/dir.c:1805 [inline] BUG: KASAN: slab-out-of-bounds in ocfs2_dir_foreach_blk+0x1501/0x18a0 fs/ocfs2/dir.c:1933 Read of size 2 at addr ffff888011a1e3d0 by task syz.0.0/5326 CPU: 0 UID: 0 PID: 5326 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 ocfs2_check_dir_entry fs/ocfs2/dir.c:305 [inline] ocfs2_dir_foreach_blk_id fs/ocfs2/dir.c:1805 [inline] ocfs2_dir_foreach_blk+0x1501/0x18a0 fs/ocfs2/dir.c:1933 ocfs2_readdir+0x254/0x4c0 fs/ocfs2/dir.c:1977 wrap_directory_iterator+0x96/0xe0 fs/readdir.c:65 iterate_dir+0x399/0x570 fs/readdir.c:108 __do_sys_getdents fs/readdir.c:326 [inline] __se_sys_getdents+0xe4/0x250 fs/readdir.c:312 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:0x7fbb4998f6c9 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:00007fbb4a838038 EFLAGS: 00000246 ORIG_RAX: 000000000000004e RAX: ffffffffffffffda RBX: 00007fbb49be6180 RCX: 00007fbb4998f6c9 RDX: 0000000000000058 RSI: 0000000000000000 RDI: 0000000000000007 RBP: 00007fbb49a11f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fbb49be6218 R14: 00007fbb49be6180 R15: 00007ffc9b3ee388 Allocated by task 4729: 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 lib/maple_tree.c:3017 [inline] mas_commit_b_node+0x80b/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_insert+0x375/0x550 lib/maple_tree.c:4002 mas_alloc_cyclic+0x207/0x700 lib/maple_tree.c:4048 mtree_alloc_cyclic+0x181/0x220 lib/maple_tree.c:6092 simple_offset_add+0xdc/0x190 fs/libfs.c:297 shmem_mknod+0x234/0x3e0 mm/shmem.c:3855 lookup_open fs/namei.c:3796 [inline] open_last_lookups fs/namei.c:3895 [inline] path_openat+0x14f4/0x3830 fs/namei.c:4131 do_filp_open+0x1fa/0x410 fs/namei.c:4161 do_sys_openat2+0x121/0x1c0 fs/open.c:1437 do_sys_open fs/open.c:1452 [inline] __do_sys_openat fs/open.c:1468 [inline] __se_sys_openat fs/open.c:1463 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1463 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 ffff888011a1e200 which belongs to the cache maple_node of size 256 The buggy address is located 208 bytes to the right of allocated 256-byte region [ffff888011a1e200, ffff888011a1e300) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11a1e ksm flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801a04bc80 ffffea000046e080 dead000000000007 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 4697, tgid 4697 (ln), ts 25047553511, free_ts 24453911867 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x234/0x290 mm/page_alloc.c:1845 prep_new_page mm/page_alloc.c:1853 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3879 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5178 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:7406 refill_sheaf mm/slub.c:2637 [inline] kmem_cache_prefill_sheaf+0x295/0x450 mm/slub.c:5419 mt_get_sheaf lib/maple_tree.c:189 [inline] mas_alloc_nodes+0x1c2/0x350 lib/maple_tree.c:1140 mas_preallocate+0x2e0/0x670 lib/maple_tree.c:5194 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 1 tgid 1 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:2901 __free_pages mm/page_alloc.c:5297 [inline] free_reserved_page+0xce/0x120 mm/page_alloc.c:6208 free_reserved_area+0x90/0x190 mm/page_alloc.c:6194 free_init_pages arch/x86/mm/init.c:937 [inline] free_kernel_image_pages+0xa2/0x100 arch/x86/mm/init.c:953 kernel_init+0x31/0x1d0 init/main.c:1492 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: ffff888011a1e280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888011a1e300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888011a1e380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888011a1e400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888011a1e480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================