Skip to contentSkip to conversation

mm-damon-core-initialize-damo_filter-list-from-damos_new_filter.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Aug 4, 2023 Stable branch

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled

     Subject: mm/damon/core: initialize damo_filter->list from damos_new_filter()

has been removed from the -mm tree. Its filename was
mm-damon-core-initialize-damo_filter-list-from-damos_new_filter.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/core: initialize damo_filter->list from damos_new_filter()
Date: Sat, 29 Jul 2023 20:37:32 +0000

damos_new_filter() is not initializing the list field of newly allocated filter object. However, DAMON sysfs interface and DAMON_RECLAIM are not initializing it after calling damos_new_filter(). As a result, accessing uninitialized memory is possible. Actually, adding multiple DAMOS filters via DAMON sysfs interface caused NULL pointer dereferencing. Initialize the field just after the allocation from damos_new_filter().

Fixes 98def236f63c ("mm/damon/core: implement damos filter")

---

 mm/damon/core.c |    1 +
 1 file changed, 1 insertion(+)
mm/damon/core.c renamed from mm/damon/core.c~mm-damon-core-initialize-damo_filter-list-from-damos_new_filter +1 -0
@@ -273,6 +273,7 @@ struct damos_filter *damos_new_filter(en
 		return NULL;
 	filter->type = type;
 	filter->matching = matching;
+	INIT_LIST_HEAD(&filter->list);
 	return filter;
 }
 

_

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

mm-damon-core-test-add-a-test-for-damos_new_filter.patch mm-damon-sysfs-schemes-implement-damos-tried-total-bytes-file.patch mm-damon-sysfs-implement-a-command-for-updating-only-schemes-tried-total-bytes.patch selftests-damon-sysfs-test-tried_regions-total_bytes-file.patch docs-abi-damon-update-for-tried_regions-total_bytes.patch docs-admin-guide-mm-damon-usage-update-for-tried_regions-total_bytes.patch mm-damon-core-introduce-address-range-type-damos-filter.patch mm-damon-sysfs-schemes-support-address-range-type-damos-filter.patch mm-damon-core-test-add-a-unit-test-for-__damos_filter_out.patch selftests-damon-sysfs-test-address-range-damos-filter.patch docs-mm-damon-design-update-for-address-range-filters.patch docs-abi-damon-update-for-address-range-damos-filter.patch docs-admin-guide-mm-damon-usage-update-for-address-range-type-damos-filter.patch mm-damon-core-implement-target-type-damos-filter.patch mm-damon-sysfs-schemes-support-target-damos-filter.patch selftests-damon-sysfs-test-damon_target-filter.patch docs-mm-damon-design-update-for-damon-monitoring-target-type-damos-filter.patch docs-abi-damon-update-for-damon-monitoring-target-type-damos-filter.patch docs-admin-guide-mm-damon-usage-update-for-damon-monitoring-target-type-damos-filter.patch