All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "devm_memremap_release(): fix memremap'd addr handling" has been added to the 4.4-stable tree
@ 2016-02-24  3:24 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-02-24  3:24 UTC (permalink / raw)
  To: toshi.kani, akpm, dan.j.williams, gregkh, hch, ross.zwisler,
	torvalds, willy
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    devm_memremap_release(): fix memremap'd addr handling

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     devm_memremap_release-fix-memremap-d-addr-handling.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 9273a8bbf58a15051e53a777389a502420ddc60e Mon Sep 17 00:00:00 2001
From: Toshi Kani <toshi.kani@hpe.com>
Date: Wed, 17 Feb 2016 13:11:29 -0800
Subject: devm_memremap_release(): fix memremap'd addr handling

From: Toshi Kani <toshi.kani@hpe.com>

commit 9273a8bbf58a15051e53a777389a502420ddc60e upstream.

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
so the kernel will leak a vma.

Fix devm_memremap_release() to handle a given memremap'd address
properly.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/memremap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/memremap.c
+++ b/kernel/memremap.c
@@ -111,7 +111,7 @@ EXPORT_SYMBOL(memunmap);
 
 static void devm_memremap_release(struct device *dev, void *res)
 {
-	memunmap(res);
+	memunmap(*(void **)res);
 }
 
 static int devm_memremap_match(struct device *dev, void *res, void *match_data)


Patches currently in stable-queue which might be from toshi.kani@hpe.com are

queue-4.4/x86-uaccess-64-handle-the-caching-of-4-byte-nocache-copies-properly-in-__copy_user_nocache.patch
queue-4.4/devm_memremap_release-fix-memremap-d-addr-handling.patch
queue-4.4/x86-mm-fix-vmalloc_fault-to-handle-large-pages-properly.patch
queue-4.4/x86-uaccess-64-make-the-__copy_user_nocache-assembly-code-more-readable.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-02-24  3:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-24  3:24 Patch "devm_memremap_release(): fix memremap'd addr handling" has been added to the 4.4-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.