]> git.baikalelectronics.ru Git - kernel.git/commit
mm: fix memory leak in copy_huge_pmd()
authorMatthew Wilcox <matthew.r.wilcox@intel.com>
Wed, 3 Feb 2016 00:57:57 +0000 (16:57 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Feb 2016 16:28:43 +0000 (08:28 -0800)
commit254cf80e5bbb4d8be8176b3d98861e8efe1b57b6
treef6b95cb55c397b738b8509c03d895fa8e2bd6f21
parente2ad7362f52d2338e78ee1d64db32045778f98ea
mm: fix memory leak in copy_huge_pmd()

We allocate a pgtable but do not attach it to anything if the PMD is in
a DAX VMA, causing it to leak.

We certainly try to not free pgtables associated with the huge zero page
if the zero page is in a DAX VMA, so I think this is the right solution.
This needs to be properly audited.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/huge_memory.c