================================================================== BUG: KASAN: slab-use-after-free in ocfs2_fault+0xe9/0x3d0 fs/ocfs2/mmap.c:41 Read of size 8 at addr ffff88802cacf270 by task syz.3.365/8872 CPU: 1 UID: 0 PID: 8872 Comm: syz.3.365 Not tainted 6.12.0-rc3-syzkaller-00044-g2f87d0916ce0 #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:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 ocfs2_fault+0xe9/0x3d0 fs/ocfs2/mmap.c:41 __do_fault+0x135/0x460 mm/memory.c:4876 do_read_fault mm/memory.c:5282 [inline] do_fault mm/memory.c:5416 [inline] do_pte_missing mm/memory.c:3965 [inline] handle_pte_fault+0x2d1c/0x6800 mm/memory.c:5751 __handle_mm_fault mm/memory.c:5894 [inline] handle_mm_fault+0x1053/0x1ad0 mm/memory.c:6062 do_user_addr_fault arch/x86/mm/fault.c:1389 [inline] handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x2b9/0x8c0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0010:do_strncpy_from_user lib/strncpy_from_user.c:41 [inline] RIP: 0010:strncpy_from_user+0xa7/0x250 lib/strncpy_from_user.c:127 Code: bf 07 00 00 00 4c 89 fe e8 86 cb a8 fc 49 83 ff 07 0f 86 8b 00 00 00 4c 89 3c 24 49 c7 c5 f8 ff ff ff 45 31 e4 48 8b 44 24 08 <4e> 8b 3c 20 48 b8 ff fe fe fe fe fe fe fe 49 8d 2c 07 4c 89 fb 48 RSP: 0018:ffffc90009057cd0 EFLAGS: 00050246 RAX: 0000000020000200 RBX: 0000000020000200 RCX: ffff8880550fda00 RDX: 0000000000000000 RSI: 0000000000000fe0 RDI: 0000000000000007 RBP: ffff88805d631120 R08: ffffffff84ec205a R09: 1ffffffff2037a35 R10: dffffc0000000000 R11: fffffbfff2037a36 R12: 0000000000000000 R13: fffffffffffffff8 R14: ffff88805d631120 R15: 0000000000000fe0 getname_flags+0xf1/0x540 fs/namei.c:150 vfs_fstatat fs/stat.c:340 [inline] vfs_stat include/linux/fs.h:3358 [inline] __do_sys_newstat fs/stat.c:478 [inline] __se_sys_newstat fs/stat.c:474 [inline] __x64_sys_newstat+0xde/0x190 fs/stat.c:474 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:0x7f87b8d7dff9 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:00007f87b87ff038 EFLAGS: 00000246 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 00007f87b8f36058 RCX: 00007f87b8d7dff9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000200 RBP: 00007f87b8df0296 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f87b8f36058 R15: 00007ffce6183de8 Allocated by task 8872: 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:319 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] kmem_cache_alloc_noprof+0x135/0x2a0 mm/slub.c:4141 vm_area_alloc+0x24/0x1d0 kernel/fork.c:472 mmap_region+0x1132/0x2990 mm/mmap.c:1424 do_mmap+0x8f0/0x1000 mm/mmap.c:496 vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:588 ksys_mmap_pgoff+0x4eb/0x720 mm/mmap.c:542 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 Freed by task 16: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kmem_cache_free+0x1a2/0x420 mm/slub.c:4681 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2823 handle_softirqs+0x2c5/0x980 kernel/softirq.c:554 run_ksoftirqd+0xca/0x130 kernel/softirq.c:927 smpboot_thread_fn+0x544/0xa30 kernel/smpboot.c:164 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:541 __call_rcu_common kernel/rcu/tree.c:3086 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:3190 remove_vma mm/vma.c:337 [inline] vms_complete_munmap_vmas+0x665/0x910 mm/vma.c:1156 mmap_region+0x10a4/0x2990 mm/mmap.c:1533 do_mmap+0x8f0/0x1000 mm/mmap.c:496 vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:588 ksys_mmap_pgoff+0x4eb/0x720 mm/mmap.c:542 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 ffff88802cacf1f0 which belongs to the cache vm_area_struct of size 184 The buggy address is located 128 bytes inside of freed 184-byte region [ffff88802cacf1f0, ffff88802cacf2a8) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2cacf memcg:ffff888030bb3701 ksm flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801bafab40 ffffea000179a880 dead000000000007 raw: 0000000000000000 0000000000100010 00000001f5000000 ffff888030bb3701 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 4886, tgid 4886 (sh), ts 38796156901, free_ts 38790771147 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1545 [inline] get_page_from_freelist+0x3039/0x3180 mm/page_alloc.c:3457 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4733 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265 alloc_slab_page+0x6a/0x120 mm/slub.c:2412 allocate_slab+0x5a/0x2f0 mm/slub.c:2578 new_slab mm/slub.c:2631 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3818 __slab_alloc+0x58/0xa0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] kmem_cache_alloc_noprof+0x1c1/0x2a0 mm/slub.c:4141 vm_area_dup+0x27/0x290 kernel/fork.c:487 __split_vma+0x1cb/0xc50 mm/vma.c:384 vms_gather_munmap_vmas+0x2ee/0x15d0 mm/vma.c:1205 mmap_region+0x817/0x2990 mm/mmap.c:1387 do_mmap+0x8f0/0x1000 mm/mmap.c:496 vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:588 ksys_mmap_pgoff+0x4eb/0x720 mm/mmap.c:542 page last free pid 4885 tgid 4885 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1108 [inline] free_unref_folios+0xee2/0x18a0 mm/page_alloc.c:2686 folios_put_refs+0x76c/0x860 mm/swap.c:1007 free_pages_and_swap_cache+0x5c8/0x690 mm/swap_state.c:335 __tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline] tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:366 [inline] tlb_flush_mmu+0x3a3/0x680 mm/mmu_gather.c:373 tlb_finish_mmu+0xd4/0x200 mm/mmu_gather.c:465 exit_mmap+0x496/0xc40 mm/mmap.c:1877 __mmput+0x115/0x380 kernel/fork.c:1347 exit_mm+0x220/0x310 kernel/exit.c:571 do_exit+0x9b2/0x28e0 kernel/exit.c:926 do_group_exit+0x207/0x2c0 kernel/exit.c:1088 __do_sys_exit_group kernel/exit.c:1099 [inline] __se_sys_exit_group kernel/exit.c:1097 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1097 x64_sys_call+0x2634/0x2640 arch/x86/include/generated/asm/syscalls_64.h:232 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: ffff88802cacf100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802cacf180: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fa fb >ffff88802cacf200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802cacf280: fb fb fb fb fb fc fc fc fc fc fc fc fc 00 00 00 ffff88802cacf300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: bf 07 00 00 00 mov $0x7,%edi 5: 4c 89 fe mov %r15,%rsi 8: e8 86 cb a8 fc call 0xfca8cb93 d: 49 83 ff 07 cmp $0x7,%r15 11: 0f 86 8b 00 00 00 jbe 0xa2 17: 4c 89 3c 24 mov %r15,(%rsp) 1b: 49 c7 c5 f8 ff ff ff mov $0xfffffffffffffff8,%r13 22: 45 31 e4 xor %r12d,%r12d 25: 48 8b 44 24 08 mov 0x8(%rsp),%rax * 2a: 4e 8b 3c 20 mov (%rax,%r12,1),%r15 <-- trapping instruction 2e: 48 b8 ff fe fe fe fe movabs $0xfefefefefefefeff,%rax 35: fe fe fe 38: 49 8d 2c 07 lea (%r15,%rax,1),%rbp 3c: 4c 89 fb mov %r15,%rbx 3f: 48 rex.W