public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Mohammed Gamal <m.gamal005@gmail.com>
Cc: mtosatti@redhat.com, kvm@vger.kernel.org
Subject: Re: [PATCH] VMX: Fix and improve guest state validity checks
Date: Tue, 25 May 2010 12:37:40 +0300	[thread overview]
Message-ID: <4BFB9A64.8070803@redhat.com> (raw)
In-Reply-To: <AANLkTiliMemL7ccsaaSAQHtB-1dpclCnyHj6FE1qxI-S@mail.gmail.com>

On 05/13/2010 11:15 PM, Mohammed Gamal wrote:
> On Thu, May 13, 2010 at 9:24 AM, Avi Kivity<avi@redhat.com>  wrote:
>    
>> On 05/11/2010 07:52 PM, Mohammed Gamal wrote:
>>      
>>> - Add 's' and 'g' field checks on segment registers
>>> - Correct SS checks for request and descriptor privilege levels
>>>
>>> Signed-off-by: Mohammed Gamal<m.gamal005@gmail.com>
>>> ---
>>>   arch/x86/kvm/vmx.c |   73
>>> +++++++++++++++++++++++++++++++++++++++++++++++----
>>>   1 files changed, 67 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>>> index 777e00d..9805c2a 100644
>>> --- a/arch/x86/kvm/vmx.c
>>> +++ b/arch/x86/kvm/vmx.c
>>> @@ -2121,16 +2121,30 @@ static bool stack_segment_valid(struct kvm_vcpu
>>> *vcpu)
>>>         vmx_get_segment(vcpu,&ss, VCPU_SREG_SS);
>>>         ss_rpl = ss.selector&    SELECTOR_RPL_MASK;
>>>
>>> -       if (ss.unusable)
>>> +       if (ss.dpl != ss_rpl) /* DPL != RPL */
>>> +               return false;
>>> +
>>> +       if (ss.unusable) /* Short-circuit */
>>>                 return true;
>>>
>>>        
>> If ss.unusable, do the dpl and rpl have any meaning?
>>      
> The idea is that dpl and rpl are checked on vmentry regardless of
> whether ss is usable or not. While the other checks are performed only
> if ss is usable.
>    

Any reference to back this up?  I think rpl is valid regardless of 
ss.unusable (i.e. loading selector 0003 results in an unusable segment 
with rpl=3), but I don't see how dpl can be valid in an unusable segment.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2010-05-25  9:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-11 16:52 [PATCH] VMX: Fix and improve guest state validity checks Mohammed Gamal
2010-05-13  1:52 ` Marcelo Tosatti
2010-05-13  6:24 ` Avi Kivity
2010-05-13 20:15   ` Mohammed Gamal
2010-05-25  9:37     ` Avi Kivity [this message]
2010-05-25 10:36       ` Mohammed Gamal
2010-05-25 11:22         ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BFB9A64.8070803@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=m.gamal005@gmail.com \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox