================================================================== BUG: KASAN: use-after-free in kvm_iodevice_destructor include/kvm/iodev.h:72 [inline] BUG: KASAN: use-after-free in kvm_io_bus_destroy arch/x86/kvm/../../../virt/kvm/kvm_main.c:3401 [inline] BUG: KASAN: use-after-free in kvm_destroy_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:740 [inline] BUG: KASAN: use-after-free in kvm_put_kvm+0xd7c/0xff0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:770 Read of size 8 at addr ffff8881c5c20f90 by task syz-executor1/7048 CPU: 0 PID: 7048 Comm: syz-executor1 Not tainted 4.20.0-rc5+ #367 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+0x244/0x39d lib/dump_stack.c:113 print_address_description.cold.7+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.8+0x242/0x309 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 kvm_iodevice_destructor include/kvm/iodev.h:72 [inline] kvm_io_bus_destroy arch/x86/kvm/../../../virt/kvm/kvm_main.c:3401 [inline] kvm_destroy_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:740 [inline] kvm_put_kvm+0xd7c/0xff0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:770 kvm_vm_release+0x42/0x50 arch/x86/kvm/../../../virt/kvm/kvm_main.c:781 __fput+0x385/0xa30 fs/file_table.c:278 ____fput+0x15/0x20 fs/file_table.c:309 task_work_run+0x1e8/0x2a0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x318/0x380 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x411021 Code: 75 14 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 34 19 00 00 c3 48 83 ec 08 e8 0a fc ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 53 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:0000000000a3fd90 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000000411021 RDX: 0000000000000000 RSI: 0000000000730308 RDI: 0000000000000004 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000a3fcb0 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000001 R14: 00000000000005dd R15: 0000000000000001 Allocated by task 7054: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kmem_cache_alloc_trace+0x152/0x750 mm/slab.c:3620 kmalloc include/linux/slab.h:546 [inline] kzalloc include/linux/slab.h:741 [inline] kvm_vm_ioctl_register_coalesced_mmio+0xe8/0x4f0 arch/x86/kvm/../../../virt/kvm/coalesced_mmio.c:147 kvm_vm_ioctl+0x594/0x1d60 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3014 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:509 [inline] do_vfs_ioctl+0x1de/0x1790 fs/ioctl.c:696 ksys_ioctl+0xa9/0xd0 fs/ioctl.c:713 __do_sys_ioctl fs/ioctl.c:720 [inline] __se_sys_ioctl fs/ioctl.c:718 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7054: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3817 coalesced_mmio_destructor+0x1ad/0x2a0 arch/x86/kvm/../../../virt/kvm/coalesced_mmio.c:99 kvm_iodevice_destructor include/kvm/iodev.h:73 [inline] kvm_vm_ioctl_unregister_coalesced_mmio+0x263/0x330 arch/x86/kvm/../../../virt/kvm/coalesced_mmio.c:184 kvm_vm_ioctl+0x6bc/0x1d60 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3023 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:509 [inline] do_vfs_ioctl+0x1de/0x1790 fs/ioctl.c:696 ksys_ioctl+0xa9/0xd0 fs/ioctl.c:713 __do_sys_ioctl fs/ioctl.c:720 [inline] __se_sys_ioctl fs/ioctl.c:718 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8881c5c20f80 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 16 bytes inside of 64-byte region [ffff8881c5c20f80, ffff8881c5c20fc0) The buggy address belongs to the page: page:ffffea0007170800 count:1 mapcount:0 mapping:ffff8881da800340 index:0xffff8881c5c20e00 flags: 0x2fffc0000000200(slab) raw: 02fffc0000000200 ffffea00071d2548 ffffea000714cf48 ffff8881da800340 raw: ffff8881c5c20e00 ffff8881c5c20000 0000000100000019 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881c5c20e80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff8881c5c20f00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8881c5c20f80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8881c5c21000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881c5c21080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================