linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Toshi Kani <toshi.kani@hpe.com>
Cc: dan.j.williams@intel.com, linux-nvdimm@ml01.01.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] devm_memremap_release: fix memremap'd addr handling
Date: Tue, 16 Feb 2016 16:18:43 -0800	[thread overview]
Message-ID: <20160216161843.25aaac7046c7a79e1713c8a2@linux-foundation.org> (raw)
In-Reply-To: <1455640227-21459-1-git-send-email-toshi.kani@hpe.com>

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?

I'll add a cc:stable to this.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2016-02-17  0:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16 16:30 Toshi Kani
2016-02-17  0:18 ` Andrew Morton [this message]
2016-02-17  1:16   ` Toshi Kani
2016-02-17  0:40 ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160216161843.25aaac7046c7a79e1713c8a2@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nvdimm@ml01.01.org \
    --cc=toshi.kani@hpe.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox