Skip to contentSkip to conversation

alloc_tag-fix-page_ext_get-page_ext_put-sequence-during-page-splitting.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jul 12, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: alloc_tag: fix page_ext_get/page_ext_put sequence during page splitting
has been removed from the -mm tree. Its filename was
alloc_tag-fix-page_ext_get-page_ext_put-sequence-during-page-splitting.patch

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

------------------------------------------------------
From: Suren Baghdasaryan <[email protected]>
Subject: alloc_tag: fix page_ext_get/page_ext_put sequence during page splitting
Date: Thu, 11 Jul 2024 15:04:57 -0700

pgalloc_tag_sub() might call page_ext_put() using a page different from the one used in page_ext_get() call. This does not pose an issue since page_ext_put() ignores this parameter as long as it's non-NULL but technically this is wrong. Fix it by storing the original page used in page_ext_get() and passing it to page_ext_put().

Fixes be25d1d4e822 ("mm: create new codetag references during page splitting")
Cc Kees Cook <[email protected]>
Cc Kent Overstreet <[email protected]>
Cc Pasha Tatashin <[email protected]>
Cc Sourav Panda <[email protected]>
Cc Vlastimil Babka <[email protected]>

---

 include/linux/pgalloc_tag.h |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
include/linux/pgalloc_tag.h renamed from include/linux/pgalloc_tag.h~alloc_tag-fix-page_ext_get-page_ext_put-sequence-during-page-splitting +3 -2
@@ -71,6 +71,7 @@ static inline void pgalloc_tag_sub(struc
 static inline void pgalloc_tag_split(struct page *page, unsigned int nr)
 {
 	int i;
+	struct page_ext *first_page_ext;
 	struct page_ext *page_ext;
 	union codetag_ref *ref;
 	struct alloc_tag *tag;
@@ -78,7 +79,7 @@ static inline void pgalloc_tag_split(str
 	if (!mem_alloc_profiling_enabled())
 		return;
 
-	page_ext = page_ext_get(page);
+	first_page_ext = page_ext = page_ext_get(page);
 	if (unlikely(!page_ext))
 		return;
 
@@ -94,7 +95,7 @@ static inline void pgalloc_tag_split(str
 		page_ext = page_ext_next(page_ext);
 	}
 out:
-	page_ext_put(page_ext);
+	page_ext_put(first_page_ext);
 }
 
 static inline struct alloc_tag *pgalloc_tag_get(struct page *page)

_

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

alloc_tag-export-memory-allocation-profiling-symbols-used-by-modules.patch