All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Qian Cai <cai@lca.pw>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	kvm@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Peter Xu <peterx@redhat.com>, Marc Zyngier <maz@kernel.org>,
	Christoffer Dall <christoffer.dall@arm.com>
Subject: Re: slab-out-of-bounds due to "KVM: Dynamically size memslot array based on number of used slots"
Date: Fri, 20 Mar 2020 06:53:46 -0700	[thread overview]
Message-ID: <20200320135346.GA16533@linux.intel.com> (raw)
In-Reply-To: <5FF6AF4E-EB99-4111-BBB2-FE09FFBEF5C4@lca.pw>

On Fri, Mar 20, 2020 at 09:49:03AM -0400, Qian Cai wrote:
> 
> 
> > On Mar 20, 2020, at 12:34 AM, Sean Christopherson <sean.j.christopherson@intel.com> wrote:
> > 
> > On Thu, Mar 19, 2020 at 11:59:23PM -0400, Qian Cai wrote:
> >> Reverted the linux-next commit 36947254e5f98 (“KVM: Dynamically size memslot array based on number of used slots”)
> >> fixed illegal slab object redzone accesses.
> >> 
> >> [6727.939776][ T1818] BUG: KASAN: slab-out-of-bounds in gfn_to_hva+0xc1/0x2b0 [kvm]
> >> search_memslots at include/linux/kvm_host.h:1035
> > 
> > Drat.  I'm guessing lru_slot is out of range after a memslot is deleted.
> > This should fix the issue, though it may not be the most proper fix, e.g.
> > it might be better to reset lru_slot when deleting a memslot.  I'll try and
> > reproduce tomorrow, unless you can confirm this does the trick.
> 
> It works fine.

Thanks!  I'll send a proper patch in a bit, tweaking a selftest to try and
hit this as well.

  reply	other threads:[~2020-03-20 13:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-20  3:59 slab-out-of-bounds due to "KVM: Dynamically size memslot array based on number of used slots" Qian Cai
2020-03-20  4:34 ` Sean Christopherson
2020-03-20 13:49   ` Qian Cai
2020-03-20 13:53     ` Sean Christopherson [this message]
2020-03-20 16:08       ` Peter Xu

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=20200320135346.GA16533@linux.intel.com \
    --to=sean.j.christopherson@intel.com \
    --cc=cai@lca.pw \
    --cc=christoffer.dall@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterx@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.