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, 16 Feb 2016 18:16:01 -0700
From:	Toshi Kani <toshi.kani@....com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	dan.j.williams@...el.com, linux-nvdimm@...1.01.org,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	Christoph Hellwig <hch@....de>
Subject: Re: [PATCH] devm_memremap_release: fix memremap'd addr handling

On Tue, 2016-02-16 at 16:18 -0800, Andrew Morton wrote:
> On Tue, 16 Feb 2016 09:30:27 -0700 Toshi Kani <toshi.kani@....com> wrote:
> 
> > The pmem driver calls devm_memremap() to map a persistent memory
> > range.  When the pmem driver is unloaded, this memremap'd range
> > is not released.
> > 
> > Fix devm_memremap_release() to handle a given memremap'd address
> > properly.
> > 
> > ...
> > 
> > --- a/kernel/memremap.c
> > +++ b/kernel/memremap.c
> > @@ -114,7 +114,7 @@ EXPORT_SYMBOL(memunmap);
> >  
> >  static void devm_memremap_release(struct device *dev, void *res)
> >  {
> > -	memunmap(res);
> > +	memunmap(*(void **)res);
> >  }
> >  
> 
> Huh.  So what happens?  memunmap() decides it isn't a vmalloc address
> and we leak a vma?

Yes, that's right.

> I'll add a cc:stable to this.

Agreed.

Thanks!
-Toshi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ