lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 25 May 2010 17:27:32 -0700
From:	Suresh Siddha <suresh.b.siddha@...el.com>
To:	Xiaotian Feng <dfeng@...hat.com>
Cc:	"x86@...nel.org" <x86@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>, Jack Steiner <steiner@....com>,
	Venkatesh Pallipadi <venki@...gle.com>
Subject: Re: [PATCH] x86/pat: fix memory leak in free_memtype

On Tue, 2010-05-25 at 17:12 -0700, Suresh Siddha wrote:
> On Tue, 2010-05-25 at 02:52 -0700, Xiaotian Feng wrote:
> > reserve_memtype will allocate memory for new memtype, but
> > in free_memtype, after the memtype erased from rbtree, the
> > memory is not freed.
> > 
> > Signed-off-by: Xiaotian Feng <dfeng@...hat.com>
> > Cc: Thomas Gleixner <tglx@...utronix.de>
> > Cc: Ingo Molnar <mingo@...hat.com>
> > Cc: "H. Peter Anvin" <hpa@...or.com>
> > Cc: Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>
> > Cc: Jack Steiner <steiner@....com>
> > Cc: Suresh Siddha <suresh.b.siddha@...el.com>
> > ---
> >  arch/x86/mm/pat_rbtree.c |    2 ++
> >  1 files changed, 2 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/x86/mm/pat_rbtree.c b/arch/x86/mm/pat_rbtree.c
> > index 07de4cb..fb8c1e5 100644
> > --- a/arch/x86/mm/pat_rbtree.c
> > +++ b/arch/x86/mm/pat_rbtree.c
> > @@ -15,6 +15,7 @@
> >  #include <linux/rbtree.h>
> >  #include <linux/sched.h>
> >  #include <linux/gfp.h>
> > +#include <linux/slab.h>
> >  
> >  #include <asm/pgtable.h>
> >  #include <asm/pat.h>
> > @@ -240,6 +241,7 @@ int rbt_memtype_erase(u64 start, u64 end)
> >  		return -EINVAL;
> >  
> >  	rb_erase(&data->rb, &memtype_rbroot);
> > +	kfree(data);
> >  	return 0;
> >  }
> 
> Acked-by: Suresh Siddha <suresh.b.siddha@...el.com>
> 
> Peter, Please apply this for x86/urgent, this is introduced in the post
> 2.6.34 changes.

Xiaotian, Also I think more cleaner fix is to do this in free_memtype().
Can you please resend the patch with this change?

thanks,
suresh

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ