Skip to contentSkip to conversation

mm-damon-paddr-fix-folio_size-call-after-folio_put-in-damon_pa_young.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Mar 8, 2023 Stable branch

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/damon/paddr: fix folio_size() call after folio_put() in damon_pa_young()
has been removed from the -mm tree. Its filename was
mm-damon-paddr-fix-folio_size-call-after-folio_put-in-damon_pa_young.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: SeongJae Park <[email protected]>
Subject: mm/damon/paddr: fix folio_size() call after folio_put() in damon_pa_young()
Date: Sat, 4 Mar 2023 19:39:48 +0000

Patch series "mm/damon/paddr: Fix folio-use-after-put bugs".

There are two folio accesses after folio_put() in mm/damon/paddr.c file. Fix those.

This patch (of 2):

damon_pa_young() is accessing a folio via folio_size() after folio_put() for the folio has invoked. Fix it.

Fixes 397b0c3a584b ("mm/damon/paddr: remove folio_sz field from damon_pa_access_chk_result")
Cc Vishal Moola (Oracle) <[email protected]>
Cc <[email protected]> [6.2.x]

---

mm/damon/paddr.c renamed from mm/damon/paddr.c~mm-damon-paddr-fix-folio_size-call-after-folio_put-in-damon_pa_young +1 -2
@@ -130,7 +130,6 @@ static bool damon_pa_young(unsigned long
 			accessed = false;
 		else
 			accessed = true;
-		folio_put(folio);
 		goto out;
 	}
 
@@ -144,10 +143,10 @@ static bool damon_pa_young(unsigned long
 
 	if (need_lock)
 		folio_unlock(folio);
-	folio_put(folio);
 
 out:
 	*folio_sz = folio_size(folio);
+	folio_put(folio);
 	return accessed;
 }
 

_

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