Skip to contentSkip to conversation

mm-damon-sysfs-catch-commit-test-ctx-alloc-failure.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Oct 15, 2025 Stable branch

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/damon/sysfs: catch commit test ctx alloc failure
has been removed from the -mm tree. Its filename was
mm-damon-sysfs-catch-commit-test-ctx-alloc-failure.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/sysfs: catch commit test ctx alloc failure
Date: Fri, 3 Oct 2025 13:14:54 -0700

Patch series "mm/damon/sysfs: fix commit test damon_ctx [de]allocation".

DAMON sysfs interface dynamically allocates and uses a damon_ctx object for testing if given inputs for online DAMON parameters update is valid. The object is being used without an allocation failure check, and leaked when the test succeeds. Fix the two bugs.

This patch (of 2):

The damon_ctx for testing online DAMON parameters commit inputs is used without its allocation failure check. This could result in an invalid memory access. Fix it by directly returning an error when the allocation failed.

Fixes 4c9ea539ad59 ("mm/damon/sysfs: validate user inputs from damon_sysfs_commit_input()")
Cc <[email protected]> [6.15+]

---

 mm/damon/sysfs.c |    2 ++
 1 file changed, 2 insertions(+)
mm/damon/sysfs.c renamed from mm/damon/sysfs.c~mm-damon-sysfs-catch-commit-test-ctx-alloc-failure +2 -0
@@ -1473,6 +1473,8 @@ static int damon_sysfs_commit_input(void
 	if (IS_ERR(param_ctx))
 		return PTR_ERR(param_ctx);
 	test_ctx = damon_new_ctx();
+	if (!test_ctx)
+		return -ENOMEM;
 	err = damon_commit_ctx(test_ctx, param_ctx);
 	if (err) {
 		damon_destroy_ctx(test_ctx);

_

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

mm-damon-core-fix-list_add_tail-call-on-damon_call.patch mm-damon-core-use-damos_commit_quota_goal-for-new-goal-commit.patch mm-zswap-remove-unnecessary-dlen-writes-for-incompressible-pages.patch mm-zswap-fix-typos-s-zwap-zswap.patch mm-zswap-s-red-black-tree-xarray.patch docs-admin-guide-mm-zswap-s-red-black-tree-xarray.patch