Remove CPUID insn_length check
authorjob <job@openbsd.org>
Thu, 26 Jul 2018 10:05:02 +0000 (10:05 +0000)
committerjob <job@openbsd.org>
Thu, 26 Jul 2018 10:05:02 +0000 (10:05 +0000)
Don't allow unprivileged users to crash things from ring 3

Thanks to William McCall for the patch!

OK mlarkin@

sys/arch/amd64/amd64/vmm.c

index bbf8802..a007e72 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: vmm.c,v 1.216 2018/07/12 10:16:41 mlarkin Exp $       */
+/*     $OpenBSD: vmm.c,v 1.217 2018/07/26 10:05:02 job Exp $   */
 /*
  * Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
  *
@@ -5896,12 +5896,6 @@ vmm_handle_cpuid(struct vcpu *vcpu)
                        return (EINVAL);
                }
 
-               if (insn_length != 2) {
-                       DPRINTF("%s: CPUID with instruction length %lld not "
-                           "supported\n", __func__, insn_length);
-                       return (EINVAL);
-               }
-
                rax = &vcpu->vc_gueststate.vg_rax;
                msr_store =
                    (struct vmx_msr_store *)vcpu->vc_vmx_msr_exit_save_va;