]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: nSVM: Always inject a #GP if mapping VMCB12 fails on nested VMRUN
authorYosry Ahmed <yosry@kernel.org>
Tue, 3 Mar 2026 00:33:59 +0000 (00:33 +0000)
committerSean Christopherson <seanjc@google.com>
Thu, 5 Mar 2026 00:08:46 +0000 (16:08 -0800)
commit01ddcdc55e097ca38c28ae656711b8e6d1df71f8
treee4bc59b1f9a49af7f8af26761250c456707ac655
parentac17892e51525ccea892b7e3171e2d1e9bb6fa61
KVM: nSVM: Always inject a #GP if mapping VMCB12 fails on nested VMRUN

nested_svm_vmrun() currently only injects a #GP if kvm_vcpu_map() fails
with -EINVAL. But it could also fail with -EFAULT if creating a host
mapping failed. Inject a #GP in all cases, no reason to treat failure
modes differently.

Fixes: 8c5fbf1a7231 ("KVM/nSVM: Use the new mapping API for mapping guest memory")
CC: stable@vger.kernel.org
Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Yosry Ahmed <yosry@kernel.org>
Link: https://patch.msgid.link/20260303003421.2185681-6-yosry@kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/nested.c