syzbot


KCSAN: data-race in kvm_set_memslot / make_mmio_spte

Status: auto-closed as invalid on 2021/03/09 01:20
Subsystems: kvm
[Documentation on labels]
Reported-by: syzbot+fb53e346747ceef63d4f@syzkaller.appspotmail.com
First crash: 1217d, last: 1141d

Sample crash report:
==================================================================
BUG: KCSAN: data-race in kvm_set_memslot / make_mmio_spte

write to 0xffff8881027f2000 of 8 bytes by task 15431 on cpu 1:
 install_new_memslots arch/x86/kvm/../../../virt/kvm/kvm_main.c:1148 [inline]
 kvm_set_memslot+0x958/0xa10 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1224
 __kvm_set_memory_region+0x794/0x930 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1377
 kvm_set_memory_region arch/x86/kvm/../../../virt/kvm/kvm_main.c:1398 [inline]
 kvm_vm_ioctl_set_memory_region arch/x86/kvm/../../../virt/kvm/kvm_main.c:1410 [inline]
 kvm_vm_ioctl+0xacb/0x1c40 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3825
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl+0xcb/0x140 fs/ioctl.c:739
 __x64_sys_ioctl+0x3f/0x50 fs/ioctl.c:739
 do_syscall_64+0x39/0x80 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

read to 0xffff8881027f2000 of 8 bytes by task 15392 on cpu 0:
 make_mmio_spte+0x5f/0xe0 arch/x86/kvm/mmu/spte.c:50
 mark_mmio_spte+0x25/0x140 arch/x86/kvm/mmu/mmu.c:218
 set_mmio_spte arch/x86/kvm/mmu/mmu.c:243 [inline]
 set_spte+0x1f4/0x200 arch/x86/kvm/mmu/mmu.c:2588
 mmu_set_spte+0x1a2/0xc00 arch/x86/kvm/mmu/mmu.c:2641
 __direct_map+0x6ab/0x9d0 arch/x86/kvm/mmu/mmu.c:2915
 direct_page_fault+0x3c6/0x780 arch/x86/kvm/mmu/mmu.c:3738
 kvm_tdp_page_fault+0x92/0xa0 arch/x86/kvm/mmu/mmu.c:3805
 kvm_mmu_do_page_fault arch/x86/kvm/mmu.h:119 [inline]
 kvm_mmu_page_fault+0xca/0x3c0 arch/x86/kvm/mmu/mmu.c:5074
 handle_ept_misconfig+0x96/0x150 arch/x86/kvm/vmx/vmx.c:5355
 vmx_handle_exit+0x2fd/0x800 arch/x86/kvm/vmx/vmx.c:6048
 vcpu_enter_guest+0x1a2b/0x2470 arch/x86/kvm/x86.c:9081
 vcpu_run+0x24e/0x690 arch/x86/kvm/x86.c:9147
 kvm_arch_vcpu_ioctl_run+0x466/0x850 arch/x86/kvm/x86.c:9374
 kvm_vcpu_ioctl+0x562/0x8f0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3283
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl+0xcb/0x140 fs/ioctl.c:739
 __x64_sys_ioctl+0x3f/0x50 fs/ioctl.c:739
 do_syscall_64+0x39/0x80 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 15392 Comm: syz-executor.4 Not tainted 5.11.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/02/02 01:19 upstream 88bb507a74ea e6b95f32 .config console log report info ci2-upstream-kcsan-gce KCSAN: data-race in kvm_set_memslot / make_mmio_spte
2021/01/06 04:49 upstream 6207214a70bf b1c228e1 .config console log report info ci2-upstream-kcsan-gce
2020/12/03 00:00 upstream 3bb61aa61828 8c9190ef .config console log report info ci2-upstream-kcsan-gce
2020/11/17 02:23 upstream 9c87c9f41245 1bf9a662 .config console log report info ci2-upstream-kcsan-gce
* Struck through repros no longer work on HEAD.