vmx_vcpu_snapshot() copies the saved guest MSR array from userspace
without checking it. vmx_msr_guest_enter() and
vmx_msr_guest_enter_tsc_aux() write these values to the host's MSRs
before guest entry, so a non-canonical LSTAR, CSTAR or KGSBASE, or a
TSC_AUX with reserved bits set, raises #GP in the host and panics it.
Check the values on restore and fail with EINVAL, leaving the vCPU's
MSRs unchanged. STAR and SF_MASK need no check, since the CPU accepts
any value for them. PAT is not written to a host MSR, but apply the
check used for guest writes to it as well.
Reported by: llm-postcr
Fixes: 483d953a86a2 ("Initial support for bhyve save and restore.")
Fixes: f5f5f1e7d6de ("Support guest rdtscp and rdpid instructions on Intel VT-x")
MFC after: 1 week
Sponsored by: Alchemilla Ventures Private Limited