Skip to contentSkip to conversation

mm-fix-vma-anon_name-memory-leak-for-anonymous-shmem-vmas.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Jan 12, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled

     Subject: mm: fix vma->anon_name memory leak for anonymous shmem VMAs

has been removed from the -mm tree. Its filename was
mm-fix-vma-anon_name-memory-leak-for-anonymous-shmem-vmas.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Suren Baghdasaryan <[email protected]>
Subject: mm: fix vma->anon_name memory leak for anonymous shmem VMAs
Date: Wed, 4 Jan 2023 16:02:40 -0800

free_anon_vma_name() is missing a check for anonymous shmem VMA which leads to a memory leak due to refcount not being dropped. Fix this by calling anon_vma_name_put() unconditionally. It will free vma->anon_name whenever it's non-NULL.

---

 include/linux/mm_inline.h |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
include/linux/mm_inline.h renamed from include/linux/mm_inline.h~mm-fix-vma-anon_name-memory-leak-for-anonymous-shmem-vmas +1 -2
@@ -413,8 +413,7 @@ static inline void free_anon_vma_name(st
 	 * Not using anon_vma_name because it generates a warning if mmap_lock
 	 * is not held, which might be the case here.
 	 */
-	if (!vma->vm_file)
-		anon_vma_name_put(vma->anon_name);
+	anon_vma_name_put(vma->anon_name);
 }
 
 static inline bool anon_vma_name_eq(struct anon_vma_name *anon_name1,

_

Patches currently in -mm which might be from [email protected] are