BUG: Bad rss-counter state mm:0000000097b99505 idx:0 val:8946 BUG: Bad rss-counter state mm:0000000097b99505 idx:1 val:552 BUG: non-zero pgtables_bytes on freeing mm: 139264 ================================================================== BUG: KASAN: use-after-free in mm_has_notifiers include/linux/mmu_notifier.h:234 [inline] BUG: KASAN: use-after-free in mmu_notifier_release include/linux/mmu_notifier.h:273 [inline] BUG: KASAN: use-after-free in exit_mmap+0x4a5/0x530 mm/mmap.c:3099 Read of size 8 at addr ffff88805e1146d8 by task syz-executor.0/16043 CPU: 0 PID: 16043 Comm: syz-executor.0 Not tainted 5.3.0-rc1+ #80 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0xd4/0x306 mm/kasan/report.c:351 __kasan_report.cold+0x1b/0x36 mm/kasan/report.c:482 kasan_report+0x12/0x17 mm/kasan/common.c:612 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 mm_has_notifiers include/linux/mmu_notifier.h:234 [inline] mmu_notifier_release include/linux/mmu_notifier.h:273 [inline] exit_mmap+0x4a5/0x530 mm/mmap.c:3099 __mmput kernel/fork.c:1064 [inline] mmput+0x179/0x4d0 kernel/fork.c:1085 vhost_dev_cleanup+0x84e/0xc60 drivers/vhost/vhost.c:964 vhost_vsock_dev_release+0x324/0x470 drivers/vhost/vsock.c:627 __fput+0x2ff/0x890 fs/file_table.c:280 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x92f/0x2eb0 kernel/exit.c:878 do_group_exit+0x135/0x360 kernel/exit.c:982 get_signal+0x47c/0x2500 kernel/signal.c:2728 do_signal+0x87/0x1700 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x286/0x380 arch/x86/entry/common.c:159 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x5a9/0x6a0 arch/x86/entry/common.c:299 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459829 Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fee96a63c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000000459829 RDX: 0000000020000000 RSI: 000000004028af11 RDI: 0000000000000003 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fee96a646d4 R13: 00000000004c486c R14: 00000000004d8a80 R15: 00000000ffffffff Allocated by task 10450: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:487 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:460 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:495 slab_post_alloc_hook mm/slab.h:520 [inline] slab_alloc mm/slab.c:3319 [inline] kmem_cache_alloc+0x121/0x710 mm/slab.c:3483 dup_mm+0x8a/0x1430 kernel/fork.c:1337 copy_mm kernel/fork.c:1402 [inline] copy_process+0x28b7/0x6b00 kernel/fork.c:2017 _do_fork+0x146/0xfa0 kernel/fork.c:2369 __do_sys_clone kernel/fork.c:2524 [inline] __se_sys_clone kernel/fork.c:2505 [inline] __x64_sys_clone+0x18d/0x250 kernel/fork.c:2505 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 16043: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:449 kasan_slab_free+0xe/0x10 mm/kasan/common.c:457 __cache_free mm/slab.c:3425 [inline] kmem_cache_free+0x86/0x320 mm/slab.c:3693 __mmdrop+0x238/0x320 kernel/fork.c:683 mmdrop include/linux/sched/mm.h:49 [inline] __khugepaged_exit+0x31f/0x410 mm/khugepaged.c:489 khugepaged_exit include/linux/khugepaged.h:43 [inline] __mmput kernel/fork.c:1063 [inline] mmput+0x402/0x4d0 kernel/fork.c:1085 vhost_dev_cleanup+0x84e/0xc60 drivers/vhost/vhost.c:964 vhost_vsock_dev_release+0x324/0x470 drivers/vhost/vsock.c:627 __fput+0x2ff/0x890 fs/file_table.c:280 ____fput+0x16/0x20 fs/file_table.c:313 task_work_run+0x145/0x1c0 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x92f/0x2eb0 kernel/exit.c:878 do_group_exit+0x135/0x360 kernel/exit.c:982 get_signal+0x47c/0x2500 kernel/signal.c:2728 do_signal+0x87/0x1700 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x286/0x380 arch/x86/entry/common.c:159 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x5a9/0x6a0 arch/x86/entry/common.c:299 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88805e114180 which belongs to the cache mm_struct(17:syz0) of size 1496 The buggy address is located 1368 bytes inside of 1496-byte region [ffff88805e114180, ffff88805e114758) The buggy address belongs to the page: page:ffffea0001784500 refcount:1 mapcount:0 mapping:ffff88808f059c40 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea000174d588 ffffea0002727c08 ffff88808f059c40 raw: 0000000000000000 ffff88805e114180 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88805e114580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805e114600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805e114680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805e114700: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ffff88805e114780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================