All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-stable] mm-damon-tests-sysfs-kunit-fix-use-after-free-on-error-path.patch removed from -mm tree
@ 2025-11-24 23:11 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-11-24 23:11 UTC (permalink / raw)
  To: mm-commits, sj, dan.carpenter, akpm


The quilt patch titled
     Subject: mm/damon/tests/sysfs-kunit: fix use after free on error path
has been removed from the -mm tree.  Its filename was
     mm-damon-tests-sysfs-kunit-fix-use-after-free-on-error-path.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: Dan Carpenter <dan.carpenter@linaro.org>
Subject: mm/damon/tests/sysfs-kunit: fix use after free on error path
Date: Fri, 21 Nov 2025 16:36:38 +0300

Re-order these frees to avoid dereferencing "sysfs_target" after it has
been freed.

Link: https://lkml.kernel.org/r/aSBq5uSPIqsqH8zO@stanley.mountain
Fixes: ee131696794c ("mm/damon/tests/sysfs-kunit: handle alloc failures on damon_sysfs_test_add_targets()")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/damon/tests/sysfs-kunit.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/damon/tests/sysfs-kunit.h~mm-damon-tests-sysfs-kunit-fix-use-after-free-on-error-path
+++ a/mm/damon/tests/sysfs-kunit.h
@@ -76,8 +76,8 @@ static void damon_sysfs_test_add_targets
 	if (!ctx) {
 		kfree(sysfs_targets->targets_arr);
 		kfree(sysfs_targets);
-		kfree(sysfs_target);
 		kfree(sysfs_target->regions);
+		kfree(sysfs_target);
 		kunit_skip(test, "ctx alloc fail");
 	}
 
_

Patches currently in -mm which might be from dan.carpenter@linaro.org are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-24 23:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-24 23:11 [merged mm-stable] mm-damon-tests-sysfs-kunit-fix-use-after-free-on-error-path.patch removed from -mm tree Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.