[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <427038b4-a856-826c-e9f4-01678d33ab83@redhat.com>
Date: Wed, 22 Sep 2021 17:45:21 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Maxim Levitsky <mlevitsk@...hat.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, Jim Mattson <jmattson@...gle.com>,
Wanpeng Li <wanpengli@...cent.com>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>, Borislav Petkov <bp@...en8.de>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Ingo Molnar <mingo@...hat.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
Joerg Roedel <joro@...tes.org>
Subject: Re: [PATCH v3 0/7] KVM: few more SMM fixes
On 22/09/21 16:46, Sean Christopherson wrote:
> On Wed, Sep 22, 2021, Paolo Bonzini wrote:
>> On 13/09/21 16:09, Maxim Levitsky wrote:
>>> KVM: x86: nVMX: re-evaluate emulation_required on nested VM exit
>
> ...
>
>> Queued, thanks. However, I'm keeping patch 1 for 5.16 only.
>
> I'm pretty sure the above patch is wrong, emulation_required can simply be
> cleared on emulated VM-Exit.
Are you sure? I think you can at least set the host segment fields to a
data segment that requires emulation. For example the DPL of the host
DS is hardcoded to zero, but the RPL comes from the selector field and
the DS selector is not validated. Therefore a subsequent vmentry could
fail the access rights tests of 26.3.1.2 Checks on Guest Segment Registers:
DS, ES, FS, GS. The DPL cannot be less than the RPL in the selector
field if (1) the “unrestricted guest” VM-execution control is 0; (2) the
register is usable; and (3) the Type in the access-rights field is in
the range 0 – 11 (data segment or non-conforming code segment).
Paolo
Powered by blists - more mailing lists