OpenCloudOS-Kernel/arch/x86/kvm/svm
Sean Christopherson 26a0652cb4 KVM: x86: Disallow KVM_SET_SREGS{2} if incoming CR0 is invalid
Reject KVM_SET_SREGS{2} with -EINVAL if the incoming CR0 is invalid,
e.g. due to setting bits 63:32, illegal combinations, or to a value that
isn't allowed in VMX (non-)root mode.  The VMX checks in particular are
"fun" as failure to disallow Real Mode for an L2 that is configured with
unrestricted guest disabled, when KVM itself has unrestricted guest
enabled, will result in KVM forcing VM86 mode to virtual Real Mode for
L2, but then fail to unwind the related metadata when synthesizing a
nested VM-Exit back to L1 (which has unrestricted guest enabled).

Opportunistically fix a benign typo in the prototype for is_valid_cr4().

Cc: stable@vger.kernel.org
Reported-by: syzbot+5feef0b9ee9c8e9e5689@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/000000000000f316b705fdf6e2b4@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20230613203037.1968489-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2023-07-29 11:05:31 -04:00
..
avic.c KVM: SVM: WARN if GATag generation drops VM or vCPU ID information 2023-03-14 10:20:07 -04:00
hyperv.c KVM: nSVM: hyper-v: Enable L2 TLB flush 2022-11-18 12:59:18 -05:00
hyperv.h KVM: nSVM: hyper-v: Enable L2 TLB flush 2022-11-18 12:59:18 -05:00
nested.c KVM: nSVM: Implement support for nested VNMI 2023-03-22 17:43:45 -07:00
pmu.c KVM: x86/svm/pmu: Add AMD PerfMonV2 support 2023-06-06 17:31:44 -07:00
sev.c KVM: SVM: WARN, but continue, if misc_cg_set_capacity() fails 2023-06-13 09:20:26 -07:00
svm.c KVM: x86: Disallow KVM_SET_SREGS{2} if incoming CR0 is invalid 2023-07-29 11:05:31 -04:00
svm.h KVM: SVM: Remove TSS reloading code after VMEXIT 2023-06-01 13:38:16 -07:00
svm_onhyperv.c KVM: x86: Unify pr_fmt to use module name for all KVM modules 2022-12-29 15:47:35 -05:00
svm_onhyperv.h s390: 2023-05-01 12:06:20 -07:00
svm_ops.h KVM: SVM: restore host save area from assembly 2022-11-09 12:25:33 -05:00
vmenter.S Linux 6.1-rc6 2022-11-21 23:01:51 +01:00