================================================================== 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 ffff8801c7e81210 by task syz-executor1/11042 CPU: 1 PID: 11042 Comm: syz-executor1 Not tainted 4.19.0-rc8-next-20181019+ #98 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+0x3bc/0xa70 fs/file_table.c:279 ____fput+0x15/0x20 fs/file_table.c:312 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:00007ffda3ef8910 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000000411021 RDX: 0000000000000000 RSI: 0000000000730308 RDI: 0000000000000004 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 00007ffda3ef8830 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000001 R14: 000000000000008a R15: 0000000000000001 audit: type=1804 audit(1539967607.959:56): pid=11007 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor5" name="/root/syzkaller-testdir705203081/syzkaller.1Lcit3/137/file0" dev="sda1" ino=16563 res=1 Allocated by task 11043: 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:501 [inline] do_vfs_ioctl+0x1de/0x1720 fs/ioctl.c:685 ksys_ioctl+0xa9/0xd0 fs/ioctl.c:702 __do_sys_ioctl fs/ioctl.c:709 [inline] __se_sys_ioctl fs/ioctl.c:707 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:707 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 11043: 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:501 [inline] do_vfs_ioctl+0x1de/0x1720 fs/ioctl.c:685 ksys_ioctl+0xa9/0xd0 fs/ioctl.c:702 __do_sys_ioctl fs/ioctl.c:709 [inline] __se_sys_ioctl fs/ioctl.c:707 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:707 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 ffff8801c7e81200 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 16 bytes inside of 64-byte region [ffff8801c7e81200, ffff8801c7e81240) The buggy address belongs to the page: page:ffffea00071fa040 count:1 mapcount:0 mapping:ffff8801da800340 index:0xffff8801c7e81b80 flags: 0x2fffc0000000200(slab) raw: 02fffc0000000200 ffffea0007078d08 ffffea00073c0688 ffff8801da800340 raw: ffff8801c7e81b80 ffff8801c7e81000 000000010000001a 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c7e81100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8801c7e81180: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8801c7e81200: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8801c7e81280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8801c7e81300: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================