================================================================== 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+0x1099/0x2570 fs/ocfs2/suballoc.c:1982 Read of size 4 at addr ffff88803fbac1d0 by task syz.0.15/5613 CPU: 0 UID: 0 PID: 5613 Comm: syz.0.15 Not tainted 6.11.0-rc6-syzkaller-gc763c4339688 #0 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 lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 ocfs2_find_victim_chain fs/ocfs2/suballoc.c:1445 [inline] ocfs2_claim_suballoc_bits+0x1099/0x2570 fs/ocfs2/suballoc.c:1982 ocfs2_claim_metadata+0x16d/0x580 fs/ocfs2/suballoc.c:2057 ocfs2_create_refcount_tree+0x699/0x15f0 fs/ocfs2/refcounttree.c:590 ocfs2_reflink_remap_blocks+0x2f6/0x1f30 fs/ocfs2/refcounttree.c:4634 ocfs2_remap_file_range+0x600/0x8e0 fs/ocfs2/file.c:2724 vfs_copy_file_range+0xc1f/0x1530 fs/read_write.c:1522 __do_sys_copy_file_range fs/read_write.c:1612 [inline] __se_sys_copy_file_range+0x3f2/0x5d0 fs/read_write.c:1575 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:0x7f7f21d79e79 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:00007f7f22bbf038 EFLAGS: 00000246 ORIG_RAX: 0000000000000146 RAX: ffffffffffffffda RBX: 00007f7f21f15f80 RCX: 00007f7f21d79e79 RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000006 RBP: 00007f7f21de7916 R08: 0000000000000006 R09: 0000000000000000 R10: 00000000200000c0 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f7f21f15f80 R15: 00007ffdfe2ff708 Allocated by task 4792: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3992 [inline] slab_alloc_node mm/slub.c:4041 [inline] kmem_cache_alloc_noprof+0x135/0x2a0 mm/slub.c:4048 alloc_empty_file+0x9e/0x1d0 fs/file_table.c:202 path_openat+0x105/0x3470 fs/namei.c:3872 do_filp_open+0x235/0x490 fs/namei.c:3913 do_open_execat fs/exec.c:972 [inline] alloc_bprm+0x171/0xda0 fs/exec.c:1584 do_execveat_common+0x18c/0x6f0 fs/exec.c:1978 do_execve fs/exec.c:2101 [inline] __do_sys_execve fs/exec.c:2177 [inline] __se_sys_execve fs/exec.c:2172 [inline] __x64_sys_execve+0x92/0xb0 fs/exec.c:2172 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 ffff88803fbac000 which belongs to the cache filp of size 464 The buggy address is located 0 bytes to the right of allocated 464-byte region [ffff88803fbac000, ffff88803fbac1d0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3fbac head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88803d8c6881 flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 04fff00000000040 ffff88801be91b40 ffffea0000d57900 dead000000000004 raw: 0000000000000000 00000000000c000c 00000001fdffffff ffff88803d8c6881 head: 04fff00000000040 ffff88801be91b40 ffffea0000d57900 dead000000000004 head: 0000000000000000 00000000000c000c 00000001fdffffff ffff88803d8c6881 head: 04fff00000000001 ffffea0000feeb01 ffffffffffffffff 0000000000000000 head: ffff888000000002 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4736, tgid 4736 (v4l_id), ts 47406042927, free_ts 47386534276 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1500 prep_new_page mm/page_alloc.c:1508 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3446 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4702 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2325 allocate_slab+0x5a/0x2f0 mm/slub.c:2488 new_slab mm/slub.c:2541 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3727 __slab_alloc+0x58/0xa0 mm/slub.c:3817 __slab_alloc_node mm/slub.c:3870 [inline] slab_alloc_node mm/slub.c:4029 [inline] kmem_cache_alloc_noprof+0x1c1/0x2a0 mm/slub.c:4048 alloc_empty_file+0x9e/0x1d0 fs/file_table.c:202 path_openat+0x105/0x3470 fs/namei.c:3872 do_filp_open+0x235/0x490 fs/namei.c:3913 do_sys_openat2+0x13e/0x1d0 fs/open.c:1416 do_sys_open fs/open.c:1431 [inline] __do_sys_openat fs/open.c:1447 [inline] __se_sys_openat fs/open.c:1442 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1442 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 page last free pid 4731 tgid 4731 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1101 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2619 mm_free_pgd kernel/fork.c:802 [inline] __mmdrop+0xb9/0x3d0 kernel/fork.c:918 mmdrop include/linux/sched/mm.h:55 [inline] mmdrop_sched include/linux/sched/mm.h:83 [inline] mmdrop_lazy_tlb_sched include/linux/sched/mm.h:110 [inline] finish_task_switch+0x304/0x870 kernel/sched/core.c:5087 context_switch kernel/sched/core.c:5191 [inline] __schedule+0x1808/0x4a60 kernel/sched/core.c:6529 preempt_schedule_common+0x84/0xd0 kernel/sched/core.c:6708 preempt_schedule+0xe1/0xf0 kernel/sched/core.c:6732 preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk.S:12 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] _raw_spin_unlock_irqrestore+0x130/0x140 kernel/locking/spinlock.c:194 spin_unlock_irqrestore include/linux/spinlock.h:406 [inline] __wake_up_common_lock+0x18c/0x1e0 kernel/sched/wait.c:108 pipe_write+0x128d/0x1a40 fs/pipe.c:602 new_sync_write fs/read_write.c:497 [inline] vfs_write+0xa72/0xc90 fs/read_write.c:590 ksys_write+0x1a0/0x2c0 fs/read_write.c:643 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: ffff88803fbac080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88803fbac100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88803fbac180: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ^ ffff88803fbac200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88803fbac280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================