On Fri, Mar 20, 2020 at 06:53:46AM -0700, Sean Christopherson wrote: > 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@xxxxxxxxx> 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. Would resetting lru_slot be better? So to avoid other potential references to an obsolete lru_slot outside search_memslots(). E.g., I see that s390 has another function (gfn_to_memslot_approx) used it. Thanks, -- Peter Xu