* Patch "mm/cma: make kmemleak ignore CMA regions" has been added to the 3.18-stable tree
@ 2017-08-31 5:57 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-08-31 5:57 UTC (permalink / raw)
To: treding, akpm, aneesh.kumar, catalin.marinas, gregkh,
iamjoonsoo.kim, m.szyprowski, mina86, sfr, torvalds
Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
mm/cma: make kmemleak ignore CMA regions
to the 3.18-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:
mm-cma-make-kmemleak-ignore-cma-regions.patch
and it can be found in the queue-3.18 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 620951e2745750de1482128615adc15b74ee37ed Mon Sep 17 00:00:00 2001
From: Thierry Reding <treding@nvidia.com>
Date: Fri, 12 Dec 2014 16:58:31 -0800
Subject: mm/cma: make kmemleak ignore CMA regions
From: Thierry Reding <treding@nvidia.com>
commit 620951e2745750de1482128615adc15b74ee37ed upstream.
kmemleak will add allocations as objects to a pool. The memory allocated
for each object in this pool is periodically searched for pointers to
other allocated objects. This only works for memory that is mapped into
the kernel's virtual address space, which happens not to be the case for
most CMA regions.
Furthermore, CMA regions are typically used to store data transferred to
or from a device and therefore don't contain pointers to other objects.
Without this, the kernel crashes on the first execution of the
scan_gray_list() because it tries to access highmem. Perhaps a more
appropriate fix would be to reject any object that can't map to a kernel
virtual address?
[akpm@linux-foundation.org: add comment]
[akpm@linux-foundation.org: fix comment, per Catalin]
[sfr@canb.auug.org.au: include linux/io.h for phys_to_virt()]
Signed-off-by: Thierry Reding <treding@nvidia.com>
Cc: Michal Nazarewicz <mina86@mina86.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
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>
---
mm/cma.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -33,6 +33,7 @@
#include <linux/log2.h>
#include <linux/cma.h>
#include <linux/highmem.h>
+#include <linux/io.h>
struct cma {
unsigned long base_pfn;
@@ -325,6 +326,11 @@ int __init cma_declare_contiguous(phys_a
}
}
+ /*
+ * kmemleak scans/reads tracked objects for pointers to other
+ * objects but this address isn't mapped and accessible
+ */
+ kmemleak_ignore(phys_to_virt(addr));
base = addr;
}
Patches currently in stable-queue which might be from treding@nvidia.com are
queue-3.18/mm-cma-make-kmemleak-ignore-cma-regions.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-08-31 5:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-31 5:57 Patch "mm/cma: make kmemleak ignore CMA regions" has been added to the 3.18-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.