Re: [PATCH 1/4] KVM: nSVM: Reject KVM_SET_NESTED_STATE if L1 has EFER.LMA=1 && EFER.LME=0
From: Paolo Bonzini
Date: Fri Aug 28 2026 - 01:27:26 EST
On Fri, Aug 28, 2026 at 12:01 AM Yosry Ahmed <yosry@xxxxxxxxxx> wrote:
>
> On Thu, Aug 27, 2026 at 2:42 PM Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote:> >> If the goal here is to keep the checks here consistent with
> > >> nested_svm_check_permissions(), aside from the new EFER check, then
> > >> maybe we should also check CPL here?
> > Perhaps, but nested_svm_check_permissions() is not reached with CPL=0
> > because the #GP overrides the interception (table 15-7, instruction
> > intercepts). The same should be true about EFLAGS.VM=1.
>
> It is reachable in the odd cases where KVM intercepts #GP.
Oh right, it does not use the emulator (which would also perform the check).
> But either way, I think having a CPL check in KVM_SET_NESTED_STATE is
> probably the right thing to do.
Yes, that makes sense.
Paolo