All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Eugene Korenevsky <ekorenevsky@gmail.com>,
	kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v5 1/3] kvm: vmx: fix limit checking in get_vmx_mem_address()
Date: Fri, 7 Jun 2019 08:00:07 -0700	[thread overview]
Message-ID: <20190607150007.GB9083@linux.intel.com> (raw)
In-Reply-To: <20190607060248.GA29087@dnote>

On Fri, Jun 07, 2019 at 09:02:48AM +0300, Eugene Korenevsky wrote:
> Intel SDM vol. 3, 5.3:
> The processor causes a
> general-protection exception (or, if the segment is SS, a stack-fault
> exception) any time an attempt is made to access the following addresses
> in a segment:
> - A byte at an offset greater than the effective limit
> - A word at an offset greater than the (effective-limit – 1)
> - A doubleword at an offset greater than the (effective-limit – 3)
> - A quadword at an offset greater than the (effective-limit – 7)
> 
> Therefore, the generic limit checking error condition must be
> 
> exn = (off > limit + 1 - access_len) = (off + access_len - 1 > limit)
> 
> but not
> 
> exn = (off + access_len > limit)
> 
> as for now.
> 
> Also avoid integer overflow of `off` at 32-bit KVM by casting it to u64.
> 
> Note: access length is currently sizeof(u64) which is incorrect. This
> will be fixed in the subsequent patch.
> 
> Signed-off-by: Eugene Korenevsky <ekorenevsky@gmail.com>

When sending a new revision of a patch, please add any supplied tags to
the changelog, e.g. Reviewed-by, Tested-by, Acked-by, etc...  For example,
my Reviewed-by for v4 of this patch.

The one situation where you don't want to carry tags is if you make
non-trivial changes to a patch, e.g. person X reviews a patch but then
it gets reworked based on feedback from person Y, in which case the
Reviewed-by from X should be dropped as they haven't reviewed the new
code.

Thans for the patches!

Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>

      reply	other threads:[~2019-06-07 15:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-07  6:02 [PATCH v5 1/3] kvm: vmx: fix limit checking in get_vmx_mem_address() Eugene Korenevsky
2019-06-07 15:00 ` Sean Christopherson [this message]

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=20190607150007.GB9083@linux.intel.com \
    --to=sean.j.christopherson@intel.com \
    --cc=ekorenevsky@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.