[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200320135346.GA16533@linux.intel.com>
Date: Fri, 20 Mar 2020 06:53:46 -0700
From: Sean Christopherson <sean.j.christopherson@...el.com>
To: Qian Cai <cai@....pw>
Cc: Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
Peter Xu <peterx@...hat.com>, Marc Zyngier <maz@...nel.org>,
Christoffer Dall <christoffer.dall@....com>
Subject: Re: slab-out-of-bounds due to "KVM: Dynamically size memslot array
based on number of used slots"
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@...el.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.
Powered by blists - more mailing lists