================================================================== BUG: KASAN: slab-out-of-bounds in ocfs2_find_victim_chain fs/ocfs2/suballoc.c:1445 [inline] BUG: KASAN: slab-out-of-bounds in ocfs2_claim_suballoc_bits+0x10d3/0x2560 fs/ocfs2/suballoc.c:1982 Read of size 4 at addr ffff888031ae80c0 by task syz.6.1812/12718 CPU: 1 UID: 0 PID: 12718 Comm: syz.6.1812 Not tainted 6.13.0-rc2-syzkaller-00036-g231825b2e1ff #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 ocfs2_find_victim_chain fs/ocfs2/suballoc.c:1445 [inline] ocfs2_claim_suballoc_bits+0x10d3/0x2560 fs/ocfs2/suballoc.c:1982 ocfs2_claim_metadata+0x16d/0x580 fs/ocfs2/suballoc.c:2057 ocfs2_dx_dir_attach_index+0x231/0xf90 fs/ocfs2/dir.c:2308 ocfs2_expand_inline_dir fs/ocfs2/dir.c:3000 [inline] ocfs2_extend_dir+0x439f/0x53c0 fs/ocfs2/dir.c:3182 ocfs2_prepare_dir_for_insert+0x33b5/0x5c40 fs/ocfs2/dir.c:4287 ocfs2_mknod+0xcaf/0x2b30 fs/ocfs2/namei.c:294 ocfs2_create+0x1ab/0x470 fs/ocfs2/namei.c:674 lookup_open fs/namei.c:3649 [inline] open_last_lookups fs/namei.c:3748 [inline] path_openat+0x1c03/0x3590 fs/namei.c:3984 do_filp_open+0x27f/0x4e0 fs/namei.c:4014 do_sys_openat2+0x13e/0x1d0 fs/open.c:1402 do_sys_open fs/open.c:1417 [inline] __do_sys_creat fs/open.c:1495 [inline] __se_sys_creat fs/open.c:1489 [inline] __x64_sys_creat+0x123/0x170 fs/open.c:1489 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:0x7f2136b7ff19 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:00007f21379e7058 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f2136d45fa0 RCX: 00007f2136b7ff19 RDX: 0000000000000000 RSI: 0000000000000010 RDI: 0000000020000100 RBP: 00007f2136bf3cc8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f2136d45fa0 R15: 00007ffd16290d28 Allocated by task 9019: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4283 [inline] __kmalloc_noprof+0x285/0x4c0 mm/slub.c:4295 kmalloc_noprof include/linux/slab.h:905 [inline] memcg_init_list_lru_one mm/list_lru.c:407 [inline] memcg_list_lru_alloc+0x2c5/0x9e0 mm/list_lru.c:538 __memcg_slab_post_alloc_hook+0x140/0x7e0 mm/memcontrol.c:2991 memcg_slab_post_alloc_hook mm/slub.c:2152 [inline] slab_post_alloc_hook mm/slub.c:4114 [inline] slab_alloc_node mm/slub.c:4153 [inline] kmem_cache_alloc_lru_noprof+0x28e/0x390 mm/slub.c:4172 __d_alloc+0x31/0x700 fs/dcache.c:1646 d_alloc_pseudo+0x1f/0xb0 fs/dcache.c:1778 alloc_path_pseudo fs/file_table.c:356 [inline] alloc_file_pseudo+0x123/0x290 fs/file_table.c:372 __anon_inode_getfile fs/anon_inodes.c:109 [inline] __anon_inode_getfd fs/anon_inodes.c:234 [inline] anon_inode_getfd+0xce/0x1e0 fs/anon_inodes.c:269 fscontext_create_fd fs/fsopen.c:90 [inline] __do_sys_fsopen fs/fsopen.c:147 [inline] __se_sys_fsopen+0x233/0x2c0 fs/fsopen.c:114 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 ffff888031ae8000 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 0 bytes to the right of allocated 192-byte region [ffff888031ae8000, ffff888031ae80c0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888031ae8d00 pfn:0x31ae8 anon flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801ac413c0 0000000000000000 dead000000000001 raw: ffff888031ae8d00 000000000010000f 00000001f5000000 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 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 5957, tgid 5955 (syz.0.18), ts 78936589374, free_ts 78927833854 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0x3651/0x37a0 mm/page_alloc.c:3474 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4751 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_slab_page+0x59/0x110 mm/slub.c:2410 allocate_slab+0x5a/0x2b0 mm/slub.c:2574 new_slab mm/slub.c:2627 [inline] ___slab_alloc+0xc27/0x14a0 mm/slub.c:3815 __slab_alloc+0x58/0xa0 mm/slub.c:3905 __slab_alloc_node mm/slub.c:3980 [inline] slab_alloc_node mm/slub.c:4141 [inline] __do_kmalloc_node mm/slub.c:4282 [inline] __kmalloc_node_noprof+0x2ee/0x4d0 mm/slub.c:4289 kmalloc_array_node_noprof include/linux/slab.h:1018 [inline] alloc_slab_obj_exts+0x3a/0xa0 mm/slub.c:1964 __memcg_slab_post_alloc_hook+0x319/0x7e0 mm/memcontrol.c:3005 memcg_slab_post_alloc_hook mm/slub.c:2152 [inline] slab_post_alloc_hook mm/slub.c:4114 [inline] slab_alloc_node mm/slub.c:4153 [inline] kmem_cache_alloc_noprof+0x287/0x380 mm/slub.c:4160 alloc_empty_file_noaccount fs/file_table.c:262 [inline] alloc_file_pseudo_noaccount+0x1da/0x330 fs/file_table.c:398 bdev_file_open_by_dev+0x173/0x220 block/bdev.c:1010 setup_bdev_super+0x5d/0x5d0 fs/super.c:1554 get_tree_bdev_flags+0x3da/0x5c0 fs/super.c:1634 vfs_get_tree+0x90/0x2b0 fs/super.c:1814 page last free pid 5194 tgid 5194 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0xd2c/0x1000 mm/page_alloc.c:2657 __slab_free+0x2c2/0x380 mm/slub.c:4509 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4104 [inline] slab_alloc_node mm/slub.c:4153 [inline] __do_kmalloc_node mm/slub.c:4282 [inline] __kmalloc_noprof+0x236/0x4c0 mm/slub.c:4295 kmalloc_noprof include/linux/slab.h:905 [inline] tomoyo_realpath_from_path+0xcf/0x5e0 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x2b7/0x740 security/tomoyo/file.c:822 security_inode_getattr+0x130/0x330 security/security.c:2372 vfs_getattr+0x2a/0x3b0 fs/stat.c:243 vfs_fstat fs/stat.c:265 [inline] vfs_fstatat+0xa8/0x130 fs/stat.c:364 __do_sys_newfstatat fs/stat.c:530 [inline] __se_sys_newfstatat fs/stat.c:524 [inline] __x64_sys_newfstatat+0x11d/0x1a0 fs/stat.c:524 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: ffff888031ae7f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888031ae8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888031ae8080: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ^ ffff888031ae8100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888031ae8180: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================