]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KVM: SVM: Inject #UD for INVLPGA if EFER.SVME=0
authorKevin Cheng <chengkev@google.com>
Sat, 28 Feb 2026 03:33:26 +0000 (03:33 +0000)
committerSean Christopherson <seanjc@google.com>
Thu, 5 Mar 2026 00:08:42 +0000 (16:08 -0800)
INVLPGA should cause a #UD when EFER.SVME is not set. Add a check to
properly inject #UD when EFER.SVME=0.

Fixes: ff092385e828 ("KVM: SVM: Implement INVLPGA")
Cc: stable@vger.kernel.org
Signed-off-by: Kevin Cheng <chengkev@google.com>
Reviewed-by: Yosry Ahmed <yosry.ahmed@linux.dev>
Link: https://patch.msgid.link/20260228033328.2285047-3-chengkev@google.com
[sean: tag for stable@]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/svm.c

index d82e30c40eaa9c501573064031bccfa279791d98..543f9f3f966e3925ea42c84610b6c404ef095158 100644 (file)
@@ -2367,6 +2367,9 @@ static int invlpga_interception(struct kvm_vcpu *vcpu)
        gva_t gva = kvm_rax_read(vcpu);
        u32 asid = kvm_rcx_read(vcpu);
 
+       if (nested_svm_check_permissions(vcpu))
+               return 1;
+
        /* FIXME: Handle an address size prefix. */
        if (!is_long_mode(vcpu))
                gva = (u32)gva;