================================================================== BUG: KASAN: slab-use-after-free in handle_mm_fault+0x14f0/0x19a0 mm/memory.c:5835 Read of size 8 at addr ffff88801f450cb8 by task syz.4.2422/14860 CPU: 0 UID: 0 PID: 14860 Comm: syz.4.2422 Not tainted 6.10.0-next-20240717-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/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 handle_mm_fault+0x14f0/0x19a0 mm/memory.c:5835 do_user_addr_fault arch/x86/mm/fault.c:1338 [inline] handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x459/0x8c0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 RIP: 0033:0x7fdd8f6393e0 Code: 80 00 00 31 ff c1 e6 06 e8 fd c6 13 00 8b 55 40 49 89 07 49 03 55 00 45 85 f6 74 1b 44 89 f3 31 c0 66 0f 1f 84 00 00 00 00 00 <89> 02 83 c0 01 48 83 c2 04 39 c3 75 f3 48 83 c4 28 44 89 e0 5b 5d RSP: 002b:00007fdd905fafe0 EFLAGS: 00010206 RAX: 0000000000038760 RBX: 0000000000102c0c RCX: 00007fdd8f775ad3 RDX: 00000000200e1fff RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000020000400 R08: 00000000ffffffff R09: 0000000010000000 R10: 0000000000008001 R11: 0000000000000246 R12: ffffffffffffffff R13: 0000000020000480 R14: 0000000000102c0c R15: 00000000200004c0 Allocated by task 9395: 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:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_noprof+0x135/0x2a0 mm/slub.c:4044 vm_area_dup+0x27/0x290 kernel/fork.c:487 dup_mmap kernel/fork.c:696 [inline] dup_mm kernel/fork.c:1674 [inline] copy_mm+0xc7b/0x1f30 kernel/fork.c:1723 copy_process+0x186b/0x3d90 kernel/fork.c:2376 kernel_clone+0x226/0x8f0 kernel/fork.c:2788 __do_sys_clone kernel/fork.c:2931 [inline] __se_sys_clone kernel/fork.c:2915 [inline] __x64_sys_clone+0x258/0x2a0 kernel/fork.c:2915 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 6513: 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+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2252 [inline] slab_free mm/slub.c:4473 [inline] kmem_cache_free+0x145/0x350 mm/slub.c:4548 rcu_do_batch kernel/rcu/tree.c:2569 [inline] rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2843 handle_softirqs+0x2c4/0x970 kernel/softirq.c:554 do_softirq+0x11b/0x1e0 kernel/softirq.c:455 __local_bh_enable_ip+0x1bb/0x200 kernel/softirq.c:382 spin_unlock_bh include/linux/spinlock.h:396 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:820 [inline] nsim_dev_trap_report_work+0x75d/0xaa0 drivers/net/netdevsim/dev.c:850 process_one_work kernel/workqueue.c:3231 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3312 worker_thread+0x86d/0xd40 kernel/workqueue.c:3390 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:144 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:3106 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:3210 remove_vma mm/mmap.c:189 [inline] remove_mt mm/mmap.c:2415 [inline] do_vmi_align_munmap+0x155c/0x18c0 mm/mmap.c:2758 do_vmi_munmap+0x261/0x2f0 mm/mmap.c:2830 mmap_region+0x72f/0x2090 mm/mmap.c:2881 do_mmap+0x8f9/0x1010 mm/mmap.c:1468 vm_mmap_pgoff+0x1dd/0x3d0 mm/util.c:588 ksys_mmap_pgoff+0x4f1/0x720 mm/mmap.c:1514 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 ffff88801f450c98 which belongs to the cache vm_area_struct of size 184 The buggy address is located 32 bytes inside of freed 184-byte region [ffff88801f450c98, ffff88801f450d50) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1f450 memcg:ffff888024c11101 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000000 ffff888015eefb40 ffffea0001a6d680 dead000000000002 raw: 0000000000000000 0000000000100010 00000001fdffffff ffff888024c11101 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x152cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 11079, tgid 11079 (syz-executor), ts 630459628654, free_ts 630304475701 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1492 prep_new_page mm/page_alloc.c:1500 [inline] get_page_from_freelist+0x2ccb/0x2d80 mm/page_alloc.c:3473 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4731 __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:2321 allocate_slab+0x5a/0x2f0 mm/slub.c:2484 new_slab mm/slub.c:2537 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3723 __slab_alloc+0x58/0xa0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] kmem_cache_alloc_noprof+0x1c1/0x2a0 mm/slub.c:4044 vm_area_dup+0x27/0x290 kernel/fork.c:487 dup_mmap kernel/fork.c:696 [inline] dup_mm kernel/fork.c:1674 [inline] copy_mm+0xc7b/0x1f30 kernel/fork.c:1723 copy_process+0x186b/0x3d90 kernel/fork.c:2376 kernel_clone+0x226/0x8f0 kernel/fork.c:2788 __do_sys_clone kernel/fork.c:2931 [inline] __se_sys_clone kernel/fork.c:2915 [inline] __x64_sys_clone+0x258/0x2a0 kernel/fork.c:2915 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 12516 tgid 12516 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1093 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2643 vfree+0x186/0x2e0 mm/vmalloc.c:3364 do_free_pages sound/core/pcm_memory.c:89 [inline] snd_pcm_lib_free_pages+0x1cc/0x2a0 sound/core/pcm_memory.c:493 do_hw_free sound/core/pcm_native.c:894 [inline] snd_pcm_release_substream+0x2c6/0x490 sound/core/pcm_native.c:2714 snd_pcm_oss_release_file sound/core/oss/pcm_oss.c:2398 [inline] snd_pcm_oss_release+0x162/0x280 sound/core/oss/pcm_oss.c:2577 __fput+0x24a/0x8a0 fs/file_table.c:422 task_work_run+0x24f/0x310 kernel/task_work.c:222 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x168/0x370 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88801f450b80: fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 00 ffff88801f450c00: 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc >ffff88801f450c80: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801f450d00: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc ffff88801f450d80: fc fc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================