Skip to contentSkip to conversation

Patch "devm_memremap_release(): fix memremap'd addr handling" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Feb 24, 2016 Stable branch

lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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 <[email protected]> know about it.

Quoted 1 line

From 9273a8bbf58a15051e53a777389a502420ddc60e Mon Sep 17 00:00:00 2001

From: Toshi Kani <[email protected]>
Date: Wed, 17 Feb 2016 13:11:29 -0800
Subject: devm_memremap_release(): fix memremap'd addr handling

From: Toshi Kani <[email protected]>

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.

---
 kernel/memremap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/memremap.c +1 -1
@@ -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 [email protected] 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