public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map
@ 2012-08-23  1:04 Scott Wood
  2012-08-23  1:04 ` [PATCH 2/2] KVM: PPC: e500: MMU API: fix leak of shared_tlb_pages Scott Wood
  2012-09-25  7:46 ` [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map Alexander Graf
  0 siblings, 2 replies; 10+ messages in thread
From: Scott Wood @ 2012-08-23  1:04 UTC (permalink / raw)
  To: Alexander Graf; +Cc: kvm-ppc, kvm

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 <scottwood@freescale.com>
---
 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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] KVM: PPC: e500: MMU API: fix leak of shared_tlb_pages
  2012-08-23  1:04 [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map Scott Wood
@ 2012-08-23  1:04 ` Scott Wood
  2012-09-25  7:46   ` Alexander Graf
  2012-09-25  7:46 ` [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map Alexander Graf
  1 sibling, 1 reply; 10+ messages in thread
From: Scott Wood @ 2012-08-23  1:04 UTC (permalink / raw)
  To: Alexander Graf; +Cc: kvm-ppc, kvm

This was found by kmemleak.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 arch/powerpc/kvm/e500_tlb.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c
index a27d134..641f978 100644
--- a/arch/powerpc/kvm/e500_tlb.c
+++ b/arch/powerpc/kvm/e500_tlb.c
@@ -1134,6 +1134,8 @@ static void free_gtlb(struct kvmppc_vcpu_e500 *vcpu_e500)
 		}
 
 		vcpu_e500->num_shared_tlb_pages = 0;
+
+		kfree(vcpu_e500->shared_tlb_pages);
 		vcpu_e500->shared_tlb_pages = NULL;
 	} else {
 		kfree(vcpu_e500->gtlb_arch);
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map
  2012-08-23  1:04 [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map Scott Wood
  2012-08-23  1:04 ` [PATCH 2/2] KVM: PPC: e500: MMU API: fix leak of shared_tlb_pages Scott Wood
@ 2012-09-25  7:46 ` Alexander Graf
  2012-09-27 16:03   ` Marcelo Tosatti
  1 sibling, 1 reply; 10+ messages in thread
From: Alexander Graf @ 2012-09-25  7:46 UTC (permalink / raw)
  To: Scott Wood; +Cc: kvm-ppc, KVM list, Avi Kivity, Marcelo Tosatti


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 <scottwood@freescale.com>

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

> ---
> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] KVM: PPC: e500: MMU API: fix leak of shared_tlb_pages
  2012-08-23  1:04 ` [PATCH 2/2] KVM: PPC: e500: MMU API: fix leak of shared_tlb_pages Scott Wood
@ 2012-09-25  7:46   ` Alexander Graf
  0 siblings, 0 replies; 10+ messages in thread
From: Alexander Graf @ 2012-09-25  7:46 UTC (permalink / raw)
  To: Scott Wood; +Cc: kvm-ppc, kvm


On 23.08.2012, at 03:04, Scott Wood wrote:

> This was found by kmemleak.
> 
> Signed-off-by: Scott Wood <scottwood@freescale.com>

Thanks, applied to kvm-ppc-next.


Alex

> ---
> arch/powerpc/kvm/e500_tlb.c |    2 ++
> 1 file changed, 2 insertions(+)
> 
> diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c
> index a27d134..641f978 100644
> --- a/arch/powerpc/kvm/e500_tlb.c
> +++ b/arch/powerpc/kvm/e500_tlb.c
> @@ -1134,6 +1134,8 @@ static void free_gtlb(struct kvmppc_vcpu_e500 *vcpu_e500)
> 		}
> 
> 		vcpu_e500->num_shared_tlb_pages = 0;
> +
> +		kfree(vcpu_e500->shared_tlb_pages);
> 		vcpu_e500->shared_tlb_pages = NULL;
> 	} else {
> 		kfree(vcpu_e500->gtlb_arch);
> -- 
> 1.7.9.5
> 
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map
  2012-09-25  7:46 ` [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map Alexander Graf
@ 2012-09-27 16:03   ` Marcelo Tosatti
  2012-09-27 16:35     ` Avi Kivity
  0 siblings, 1 reply; 10+ messages in thread
From: Marcelo Tosatti @ 2012-09-27 16:03 UTC (permalink / raw)
  To: Alexander Graf, Avi Kivity; +Cc: Scott Wood, kvm-ppc, KVM list

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 <scottwood@freescale.com>
> 
> 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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map
  2012-09-27 16:03   ` Marcelo Tosatti
@ 2012-09-27 16:35     ` Avi Kivity
  2012-09-27 19:59       ` Alexander Graf
  0 siblings, 1 reply; 10+ messages in thread
From: Avi Kivity @ 2012-09-27 16:35 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Alexander Graf, Scott Wood, kvm-ppc, KVM list

On 09/27/2012 06:03 PM, Marcelo Tosatti wrote:
> 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 <scottwood@freescale.com>
>> 
>> 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.

We were discussing letting Greg honour Cc: stable@vger.kernel.org
(currently he ignores them), not sending patches directly.

We still haven't told him to do so, but Alex, you can go ahead and add
the Cc: tag to the patch.

Do you have the auto-autotest setup ready?  I guess we can do it
manually until it is.

-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map
  2012-09-27 16:35     ` Avi Kivity
@ 2012-09-27 19:59       ` Alexander Graf
  2012-09-30 11:29         ` Avi Kivity
  0 siblings, 1 reply; 10+ messages in thread
From: Alexander Graf @ 2012-09-27 19:59 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Marcelo Tosatti, Scott Wood, kvm-ppc, KVM list

On 09/27/2012 06:35 PM, Avi Kivity wrote:
> On 09/27/2012 06:03 PM, Marcelo Tosatti wrote:
>> 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<scottwood@freescale.com>
>>> 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.
> We were discussing letting Greg honour Cc: stable@vger.kernel.org
> (currently he ignores them), not sending patches directly.
>
> We still haven't told him to do so, but Alex, you can go ahead and add
> the Cc: tag to the patch.

Sure, I can certainly do that :).

> Do you have the auto-autotest setup ready?  I guess we can do it
> manually until it is.

I do have a local autotest setup. Or what exactly are you referring to?


Alex

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map
  2012-09-27 19:59       ` Alexander Graf
@ 2012-09-30 11:29         ` Avi Kivity
  2012-10-01 10:59           ` Alexander Graf
  0 siblings, 1 reply; 10+ messages in thread
From: Avi Kivity @ 2012-09-30 11:29 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Marcelo Tosatti, Scott Wood, kvm-ppc, KVM list

On 09/27/2012 09:59 PM, Alexander Graf wrote:
> 
>> Do you have the auto-autotest setup ready?  I guess we can do it
>> manually until it is.
> 
> I do have a local autotest setup. Or what exactly are you referring to?

Getting autotest to run automatically and produce readable reports, and
auto-bisection.

-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map
  2012-09-30 11:29         ` Avi Kivity
@ 2012-10-01 10:59           ` Alexander Graf
  2012-10-02 10:22             ` Avi Kivity
  0 siblings, 1 reply; 10+ messages in thread
From: Alexander Graf @ 2012-10-01 10:59 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Marcelo Tosatti, Scott Wood, kvm-ppc, KVM list


On 30.09.2012, at 13:29, Avi Kivity wrote:

> On 09/27/2012 09:59 PM, Alexander Graf wrote:
>> 
>>> Do you have the auto-autotest setup ready?  I guess we can do it
>>> manually until it is.
>> 
>> I do have a local autotest setup. Or what exactly are you referring to?
> 
> Getting autotest to run automatically and produce readable reports, and
> auto-bisection.

I'm not quite there yet :). Do you have any precooked things I could reuse?


Alex


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map
  2012-10-01 10:59           ` Alexander Graf
@ 2012-10-02 10:22             ` Avi Kivity
  0 siblings, 0 replies; 10+ messages in thread
From: Avi Kivity @ 2012-10-02 10:22 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Marcelo Tosatti, Scott Wood, kvm-ppc, KVM list

On 10/01/2012 12:59 PM, Alexander Graf wrote:
> 
> On 30.09.2012, at 13:29, Avi Kivity wrote:
> 
>> On 09/27/2012 09:59 PM, Alexander Graf wrote:
>>> 
>>>> Do you have the auto-autotest setup ready?  I guess we can do it
>>>> manually until it is.
>>> 
>>> I do have a local autotest setup. Or what exactly are you referring to?
>> 
>> Getting autotest to run automatically and produce readable reports, and
>> auto-bisection.
> 
> I'm not quite there yet :). Do you have any precooked things I could reuse?

Nope, currently we eat from the tin.


-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-10-02 10:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-23  1:04 [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map Scott Wood
2012-08-23  1:04 ` [PATCH 2/2] KVM: PPC: e500: MMU API: fix leak of shared_tlb_pages Scott Wood
2012-09-25  7:46   ` Alexander Graf
2012-09-25  7:46 ` [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map Alexander Graf
2012-09-27 16:03   ` Marcelo Tosatti
2012-09-27 16:35     ` Avi Kivity
2012-09-27 19:59       ` Alexander Graf
2012-09-30 11:29         ` Avi Kivity
2012-10-01 10:59           ` Alexander Graf
2012-10-02 10:22             ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox