From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map Date: Thu, 27 Sep 2012 13:03:34 -0300 Message-ID: <20120927160334.GB21897@amt.cnet> References: <1345683864-10815-1-git-send-email-scottwood@freescale.com> <993278D9-C731-4D08-AD3D-C7CCBC59D9D4@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Scott Wood , kvm-ppc@vger.kernel.org, KVM list To: Alexander Graf , Avi Kivity Return-path: Content-Disposition: inline In-Reply-To: <993278D9-C731-4D08-AD3D-C7CCBC59D9D4@suse.de> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Tue, Sep 25, 2012 at 09:46:01AM +0200, Alexander Graf wrote: > > On 23.08.2012, at 03:04, Scott Wood wrote: > > > We were only allocating half the bytes we need, which was made more > > obvious by a recent fix to the memset in clear_tlb1_bitmap(). > > > > Signed-off-by: Scott Wood > > Thanks, applied to kvm-ppc-next. > > Avi, Marcelo, this one should get applied to anything currently -stable as it essentially means we could overrun an array that has been allocated too small. How do we do this? > > > Alex Apparently Avi prefers that patches are sent directly to the -stable tree. Avi? > > > --- > > arch/powerpc/kvm/e500_tlb.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c > > index 43489a8..a27d134 100644 > > --- a/arch/powerpc/kvm/e500_tlb.c > > +++ b/arch/powerpc/kvm/e500_tlb.c > > @@ -1385,7 +1385,7 @@ int kvmppc_e500_tlb_init(struct kvmppc_vcpu_e500 *vcpu_e500) > > if (!vcpu_e500->gtlb_priv[1]) > > goto err; > > > > - vcpu_e500->g2h_tlb1_map = kzalloc(sizeof(unsigned int) * > > + vcpu_e500->g2h_tlb1_map = kzalloc(sizeof(u64) * > > vcpu_e500->gtlb_params[1].entries, > > GFP_KERNEL); > > if (!vcpu_e500->g2h_tlb1_map) > > -- > > 1.7.9.5 > > > > > > -- > > To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html