[folded-merged] ksm-convert-cmp_and_merge_page-to-use-a-folio-fix.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The quilt patch titled
     Subject: mm/ksm: add missing IS_ERR_OR_NULL check for stable_tree_search()
has been removed from the -mm tree.  Its filename was
     ksm-convert-cmp_and_merge_page-to-use-a-folio-fix.patch

This patch was dropped because it was folded into ksm-convert-cmp_and_merge_page-to-use-a-folio.patch

------------------------------------------------------
From: Gaosheng Cui <cuigaosheng1@xxxxxxxxxx>
Subject: mm/ksm: add missing IS_ERR_OR_NULL check for stable_tree_search()
Date: Thu, 24 Oct 2024 11:23:00 +0800

The stable_tree_search() maybe return -EBUSY if the stable node's page is
being migrated or nullptr, we need to check kfolio with IS_ERR_OR_NULL()
before dereference it.

To mitigate this, add IS_ERR_OR_NULL check for stable_tree_search().

Link: https://lkml.kernel.org/r/20241024032300.2501949-1-cuigaosheng1@xxxxxxxxxx
Signed-off-by: Gaosheng Cui <cuigaosheng1@xxxxxxxxxx>
Cc: Alex Shi <alexs@xxxxxxxxxx>
Cc: David Hildenbrand <david@xxxxxxxxxx>
Cc: "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/ksm.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/mm/ksm.c~ksm-convert-cmp_and_merge_page-to-use-a-folio-fix
+++ a/mm/ksm.c
@@ -1787,7 +1787,7 @@ static __always_inline struct folio *cha
  * with identical content to the page that we are scanning right now.
  *
  * This function returns the stable tree node of identical content if found,
- * NULL otherwise.
+ * -EBUSY if the stable node's page is being migrated, NULL otherwise.
  */
 static struct folio *stable_tree_search(struct page *page)
 {
@@ -2261,7 +2261,8 @@ static void cmp_and_merge_page(struct pa
 
 	/* Start by searching for the folio in the stable tree */
 	kfolio = stable_tree_search(page);
-	if (&kfolio->page == page && rmap_item->head == stable_node) {
+	if (!IS_ERR_OR_NULL(kfolio) && &kfolio->page == page &&
+	    rmap_item->head == stable_node) {
 		folio_put(kfolio);
 		return;
 	}
_

Patches currently in -mm which might be from cuigaosheng1@xxxxxxxxxx are

ksm-convert-cmp_and_merge_page-to-use-a-folio.patch





[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux