Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1335952

Re: [PATCH] devm_memremap_release: fix memremap'd addr handling

From Toshi Kani <toshi.kani@hpe.com>
Newsgroups linux.kernel
Subject Re: [PATCH] devm_memremap_release: fix memremap'd addr handling
Date 2016-02-17 01:30 +0100
Message-ID <r2Yae-6Sl-7@gated-at.bofh.it> (permalink)
References <r2PTl-1fi-33@gated-at.bofh.it> <r2Y0y-6P7-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@hpe.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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] devm_memremap_release: fix memremap'd addr handling Toshi Kani <toshi.kani@hpe.com> - 2016-02-16 16:40 +0100
  Re: [PATCH] devm_memremap_release: fix memremap'd addr handling Andrew Morton <akpm@linux-foundation.org> - 2016-02-17 01:20 +0100
    Re: [PATCH] devm_memremap_release: fix memremap'd addr handling Toshi Kani <toshi.kani@hpe.com> - 2016-02-17 01:30 +0100
  Re: [PATCH] devm_memremap_release: fix memremap'd addr handling Dan Williams <dan.j.williams@intel.com> - 2016-02-17 01:50 +0100

csiph-web