mm/damon: fix uninitialized DAMOS field and kunit exec expectation bugs
Subsystems (4)
SJ Park
maintainercover mm/damon: fix uninitialized DAMOS field and kunit exec expectation bugs
Fix a few Sashiko-found unurgent bugs. Patch 1 fixes use of uninitialized damos->last_applied field. Patches 2-7 fix DAMON kunit tests that do invalid memory access under test failures.
The bugs are better to be fixed and eventually merged into stable@ kernel. That said, the fixes are arguably not urgent. Patch 1 only introduces negligible DAMOS efficiency degradation in occasional cases. Kunit fixes could introduce quite bad consequences but those are test code that affect only test run setups.
Changes from RFC v1.1
- RFC v1.1: https://lore.kernel.org/[email protected]
- Drop RFC.
Changes from RFC
- RFC: https://lore.kernel.org/[email protected]
(Was not having RFC tag on the subject by a mistake)
- Add missed region split failure check in filter_out() test.
- Rebase to latest mm-new.
SJ Park (7):
mm/damon/core: initialize damos->last_applied mm/damon/core-kunit: check region count before testing in split_at() mm/damon/vaddr-kunit: check region count in three_regions test mm/damon/core-kunit: handle region split failure in filter_out() mm/damon/core-kunit: skip wrong dest walk in commit_dests_for() mm/damon/core-kunit: skip wrong quota goal walk in
commit_quota_goals()
mm/damon/core-kunit: skip wrong region walk in commit_target_regions()
mm/damon/core.c | 1 + mm/damon/tests/core-kunit.h | 30 ++++++++++++++++++++++++++++-- mm/damon/tests/vaddr-kunit.h | 5 +++++ 3 files changed, 34 insertions(+), 2 deletions(-)
base-commit: 6bb81496f18939ccbc5f16840d5b2cf1af6c995e
Signature · 1 line
2.47.3
SJ Park
maintainerPATCH 1/7 mm/damon/core: initialize damos->last_applied
Multiple DAMON regions could exist across a folio. If they fulfill the condition to apply a DAMOS scheme, the scheme could be applied multiple times to the folio. To avoid this, each DAMOS scheme stores the folio that the scheme was applied to last time in the damos->last_applied field and skips repeatedly applying the same scheme to the same folio.
The field is being used without initialization, though. Hence, the mechanism could wrongly skip applying a scheme to a folio at the very first time of DAMOS run.
The user impact is trivial. DAMON might unexpectedly skip applying DAMOS action for one folio for the first time per scheme. In the DAMON's best-effort world, this is never a real problem. No critical consequences such as kernel panic or memory corruption happen.
It is a clear bug, though, and the fix is straightforward. Fix the issue by initializing the field in DAMOS scheme creation function, damon_new_scheme().
The issue was discovered [1] by Sashiko.
[1] https://lore.kernel.org/[email protected]
--- mm/damon/core.c | 1 + 1 file changed, 1 insertion(+)
mm/damon/core.c +1 -0
@@ -705,6 +705,7 @@ struct damos *damon_new_scheme(struct damos_access_pattern *pattern,INIT_LIST_HEAD (&scheme->ops_filters); scheme->stat = (struct damos_stat ){}; scheme->max_nr_snapshots =0 ; + scheme->last_applied =NULL ;INIT_LIST_HEAD (&scheme->list); scheme->quota = *(damos_quota_init (quota));
Signature · 1 line
2.47.3
[email protected]
AI reviewRe: [PATCH 1/7] mm/damon/core: initialize damos->last_applied
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Uninitialized memory use in DAMOS quota goals allocation (last_psi_total and nid).
- [High] damos_quota_init() modifies the passed quota struct, unintentionally resetting runtime quota statistics of actively running schemes. --
--- Patch [1]: [PATCH 1/7] mm/damon/core: initialize damos->last_applied --- commit 316d27ac2ea17607b5c9df656020658fa1b425df
Author: SJ Park <[email protected]>
mm/damon/core: initialize damos->last_applied
This commit initializes the last_applied field of the damos scheme struct to NULL in damon_new_scheme(). This prevents an uninitialized value from causing a DAMON scheme to unexpectedly skip applying an action to a folio the very first time.
mm/damon/core.c struct damos *damon_new_scheme(struct damos_access_pattern *pattern, · line 711
Quoted 12 lines
mm/damon/core.c +1
-0@@ -705,6 +705,7 @@ struct damos *damon_new_scheme(struct damos_access_pattern *pattern,INIT_LIST_HEAD (&scheme->ops_filters); scheme->stat = (struct damos_stat ){}; scheme->max_nr_snapshots =0 ; + scheme->last_applied =NULL ;INIT_LIST_HEAD (&scheme->list); scheme->quota = *(damos_quota_init (quota));
[Severity: High]
This is a pre-existing issue, but does damos_quota_init() unintentionally reset the runtime statistics of actively running schemes?
When updating a DAMON context via sysfs, damon_commit_ctx() calls damon_new_test_ctx() which iterates over running schemes and calls damon_new_scheme(), passing the active &src_scheme->quota pointer.
Inside damon_new_scheme(), it executes:scheme->quota = *(damos_quota_init(quota));
If damos_quota_init() directly modifies the passed pointer:
mm/damon/core.c:damos_quota_init() {
quota->esz = 0;
quota->total_charged_sz = 0;
quota->total_charged_ns = 0;
quota->charged_sz = 0;
...
}It appears this silently clears the tracking variables of the actively running scheme, potentially breaking the ability to track memory usage limits.
[Severity: High]
This isn't a bug introduced by this patch, but while reviewing initialization, I noticed a potential issue with quota goals. Are the metric-specific fields in damos_new_quota_goal() left uninitialized?
When allocating a new goal via sysfs or damon_commit_ctx():
mm/damon/core.c:damos_new_quota_goal() {
...
goal = kmalloc_obj(*goal);
...
}It seems fields like last_psi_total and nid are not zero-initialized.
Later, damos_commit_quota_goal_union() misses the switch case for DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP, leaving dst->nid uninitialized.
This can result in using garbage values when calculating current_value:
mm/damon/core.c:damos_set_quota_goal_current_value() {
...
goal->current_value = damos_get_node_eligible_mem_bp(c, s, goal->nid);
...
}And for PSI goals:
mm/damon/core.c:damos_set_quota_goal_current_value() {
...
goal->current_value = now_psi_total - goal->last_psi_total;
goal->last_psi_total = now_psi_total;
...
}Could subtracting an uninitialized last_psi_total underflow and cause the quota tuner to aggressively zero out the quota?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
SJ Park
maintainerRe: [PATCH 1/7] mm/damon/core: initialize damos->last_applied
Quoted 54 lines · On Sat, 18 Jul 2026 00:32:20 +0000 [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Uninitialized memory use in DAMOS quota goals allocation (last_psi_totaland nid).
- [High]damos_quota_init()modifies the passed quota struct, unintentionally resetting runtime quota statistics of actively running schemes. ----- Patch [1]: [PATCH 1/7]
mm/damon/core: initializedamos->last_applied--- commit316d27ac2ea17607b5c9df656020658fa1b425df
Author: SJ Park <[email protected]>
mm/damon/core: initializedamos->last_appliedThis commit initializes the
last_appliedfield of the damos scheme struct to NULL indamon_new_scheme(). This prevents an uninitialized value from causing a DAMON scheme to unexpectedly skip applying an action to a folio the very first time.mm/damon/core.c struct damos *damon_new_scheme(struct damos_access_pattern *pattern, · line 711
Quoted 12 lines
mm/damon/core.c +1
-0@@ -705,6 +705,7 @@ struct damos *damon_new_scheme(struct damos_access_pattern *pattern,INIT_LIST_HEAD (&scheme->ops_filters); scheme->stat = (struct damos_stat ){}; scheme->max_nr_snapshots =0 ; + scheme->last_applied =NULL ;INIT_LIST_HEAD (&scheme->list); scheme->quota = *(damos_quota_init (quota));[Severity: High]
This is a pre-existing issue, but doesdamos_quota_init()unintentionally reset the runtime statistics of actively running schemes?When updating a DAMON context via sysfs,
damon_commit_ctx()callsdamon_new_test_ctx()which iterates over running schemes and callsdamon_new_scheme(), passing the active&src_scheme->quotapointer.Inside
damon_new_scheme(), it executes:scheme->quota= *(damos_quota_init(quota));If
damos_quota_init()directly modifies the passed pointer:mm/damon/core.c:damos_quota_init() { quota->esz = 0; quota->total_charged_sz = 0; quota->total_charged_ns = 0; quota->charged_sz = 0; ... }
Quoted 2 lines
It appears this silently clears the tracking variables of the actively running scheme, potentially breaking the ability to track memory usage limits.
No. The damon_new_scheme() is for a case the commit is adding new scheme to the destination context. There is no data to erase.
Quoted 19 lines
[Severity: High]
This isn't a bug introduced by this patch, but while reviewing initialization, I noticed a potential issue with quota goals. Are the metric-specific fields indamos_new_quota_goal()left uninitialized?When allocating a new goal via sysfs or
damon_commit_ctx():mm/damon/core.c:damos_new_quota_goal() { ... goal = kmalloc_obj(*goal); ... }It seems fields like
last_psi_totaland nid are not zero-initialized.Later,
damos_commit_quota_goal_union()misses the switch case forDAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP, leavingdst->niduninitialized.
Quoted 7 lines
This can result in using garbage values when calculating
current_value:mm/damon/core.c:damos_set_quota_goal_current_value() { ... goal->current_value = damos_get_node_eligible_mem_bp(c, s, goal->nid); ... }
This is no issue. The caller should set the nid. And core functions using the nid validates it before really using it.
Quoted 10 lines
And for PSI goals:
mm/damon/core.c:damos_set_quota_goal_current_value() { ... goal->current_value = now_psi_total - goal->last_psi_total; goal->last_psi_total = now_psi_total; ... }
Quoted 2 lines
Could subtracting an uninitialized
last_psi_totalunderflow and cause the quota tuner to aggressively zero out the quota?
Good finding. I will separately fix this.
Quoted 3 lines
Signature · 2 lines
-- Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Thanks,
SJ
SJ Park
maintainerPATCH 2/7 mm/damon/core-kunit: check region count before testing in split_at()
In reply to SJ Parkdamon_test_split_at() test next region that is assumed to be created by damon_split_region_at() invocation. But the split might fail. In this case, the succeeding test may dereference invalid pointers returned by damon_next_region().
The invalid pointer may not cause a really bad user impact, because of the implementation detail. It would only read wrong contents in the belonging damon_target struct. Depending on the future change of the offset from the link header to the accessing field, this could also be really dangerous, though. Still, the realistic user impact would be limited. It would affect only test run setups.
Fix it by testing if the number of regions was also changed as expected and exit early for the failure.
The issue was discovered [1] by Sashiko.
[1] https://lore.kernel.org/[email protected]
--- mm/damon/tests/core-kunit.h | 5 +++++ 1 file changed, 5 insertions(+)
mm/damon/tests/core-kunit.h +5 -0
@@ -155,6 +155,10 @@ static void damon_test_split_at(struct kunit *test) r->age =10 ;damon_add_region (r, t);damon_split_region_at (t, r,25 ); +KUNIT_EXPECT_EQ (test,damon_nr_regions (t),2 ); +if (damon_nr_regions (t) !=2 ) + goto out; +KUNIT_EXPECT_EQ (test, r->ar.start,0ul );KUNIT_EXPECT_EQ (test, r->ar.end,25ul );
@@ -166,6 +170,7 @@ static void damon_test_split_at(struct kunit *test)KUNIT_EXPECT_EQ (test, r->last_nr_accesses, r_new->last_nr_accesses);KUNIT_EXPECT_EQ (test, r->age, r_new->age); +out:damon_free_target (t); }
Signature · 1 line
2.47.3
[email protected]
AI reviewRe: [PATCH 2/7] mm/damon/core-kunit: check region count before testing in split_at()
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Silent allocation failure inside damon_split_region_at() causes an improper pointer traversal into the list head in damon_apply_min_nr_regions(), resulting in a potential infinite loop and out-of-bounds memory corruption.
- [Medium] The patch fixes an invalid pointer dereference upon split allocation failure in damon_test_split_at(), but misses an identical vulnerability in damos_test_filter_out().
--
--- Patch [2]: [PATCH 2/7] mm/damon/core-kunit: check region count before testing in split_at() --- commit 97ba538eacadf2d58d517d9d0f86ecaac4b3851f
Author: SJ Park <[email protected]>
Subject: mm/damon/core-kunit: check region count before testing in split_at()
This commit fixes an issue in the KUnit tests where damon_test_split_at() could dereference invalid pointers if a region split fails to allocate memory. The fix tests if the number of regions was changed as expected and exits early upon failure.
Quoted 5 lines
mm/damon/tests/core-kunit.h +0
-0
mm/damon/tests/core-kunit.h static void damon_test_split_at(struct kunit *test) · line 163
Quoted 9 lines
mm/damon/tests/core-kunit.h +4
-0@@ -155,6 +155,10 @@ static void damon_test_split_at(struct kunit *test) r->age =10 ;damon_add_region (r, t);damon_split_region_at (t, r,25 ); +KUNIT_EXPECT_EQ (test,damon_nr_regions (t),2 ); +if (damon_nr_regions (t) !=2 ) + goto out; +KUNIT_EXPECT_EQ (test, r->ar.start,0ul );KUNIT_EXPECT_EQ (test, r->ar.end,25ul );
[Severity: Medium]
This isn't a bug introduced by this patch, but this exact same vulnerability seems to exist later in this file in damos_test_filter_out().
If damos_filter_match() internally fails to allocate memory during a region split, the test continues and damon_next_region(r) returns the list head.
mm/damon/tests/core-kunit.h:damos_test_filter_out() {
...
/* region started before the range */ r->ar.start = 1; r->ar.end = 4; KUNIT_EXPECT_FALSE(test, damos_filter_match(NULL, t, r, f, 1)); /* filter should have split the region */ KUNIT_EXPECT_EQ(test, r->ar.start, 1); KUNIT_EXPECT_EQ(test, r->ar.end, 2); KUNIT_EXPECT_EQ(test, damon_nr_regions(t), 2); r2 = damon_next_region(r); KUNIT_EXPECT_EQ(test, r2->ar.start, 2); KUNIT_EXPECT_EQ(test, r2->ar.end, 4); damon_destroy_region(r2, t);
...
}
Should the test also be checking the region count and returning early here, before we pass an invalid pointer to damon_destroy_region() and corrupt the slab?
[Severity: High]
This is a pre-existing issue, but I'm also concerned about silent allocation failures from damon_split_region_at() in core kernel paths.
Looking at damon_apply_min_nr_regions():
mm/damon/core.c:damon_apply_min_nr_regions() {
...
damon_for_each_target(t, ctx) {
damon_for_each_region_safe(r, next, t) {
while (damon_sz_region(r) > max_region_sz) {
damon_split_region_at(t, r, max_region_sz);
r = damon_next_region(r);
}
}
}...
}
If damon_split_region_at() silently fails to allocate memory, it returns without splitting the region. The while loop then incorrectly advances r to the next region.
If this allocation failure occurs on the last region in the list, damon_next_region(r) will return the list head.
The loop condition damon_sz_region(r) > max_region_sz will evaluate memory located before the damon_target struct.
If those garbage values evaluate to true, could this result in an out-of-bounds access loop or corrupt memory? Should damon_split_region_at() return an error code that callers can check?
[ ... ]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
SJ Park
maintainerRe: [PATCH 2/7] mm/damon/core-kunit: check region count before testing in split_at()
Quoted 55 lines · On Sat, 18 Jul 2026 00:30:26 +0000 [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Silent allocation failure insidedamon_split_region_at()causes an improper pointer traversal into the list head indamon_apply_min_nr_regions(), resulting in a potential infinite loop and out-of-bounds memory corruption.
- [Medium] The patch fixes an invalid pointer dereference upon split allocation failure indamon_test_split_at(), but misses an identical vulnerability indamos_test_filter_out().
----- Patch [2]: [PATCH 2/7]
mm/damon/core-kunit: check region count before testing insplit_at()--- commit97ba538eacadf2d58d517d9d0f86ecaac4b3851f
Author: SJ Park <[email protected]>
Subject:mm/damon/core-kunit: check region count before testing insplit_at()This commit fixes an issue in the KUnit tests where
damon_test_split_at()could dereference invalid pointers if a region split fails to allocate memory. The fix tests if the number of regions was changed as expected and exits early upon failure.Quoted 5 lines
mm/damon/tests/core-kunit.h +0
-0mm/damon/tests/core-kunit.h static void damon_test_split_at(struct kunit *test) · line 163
Quoted 9 lines
mm/damon/tests/core-kunit.h +4
-0@@ -155,6 +155,10 @@ static void damon_test_split_at(struct kunit *test) r->age =10 ;damon_add_region (r, t);damon_split_region_at (t, r,25 ); +KUNIT_EXPECT_EQ (test,damon_nr_regions (t),2 ); +if (damon_nr_regions (t) !=2 ) + goto out; +KUNIT_EXPECT_EQ (test, r->ar.start,0ul );KUNIT_EXPECT_EQ (test, r->ar.end,25ul );[Severity: Medium]
This isn't a bug introduced by this patch, but this exact same vulnerability seems to exist later in this file indamos_test_filter_out().If
damos_filter_match()internally fails to allocate memory during a region split, the test continues anddamon_next_region(r)returns the list head.mm/damon/tests/core-kunit.h:damos_test_filter_out() {
.../* region started before the range */ r->ar.start = 1; r->ar.end = 4; KUNIT_EXPECT_FALSE(test, damos_filter_match(NULL, t, r, f, 1)); /* filter should have split the region */ KUNIT_EXPECT_EQ(test, r->ar.start, 1); KUNIT_EXPECT_EQ(test, r->ar.end, 2); KUNIT_EXPECT_EQ(test, damon_nr_regions(t), 2); r2 = damon_next_region(r); KUNIT_EXPECT_EQ(test, r2->ar.start, 2); KUNIT_EXPECT_EQ(test, r2->ar.end, 4); damon_destroy_region(r2, t);
Quoted 6 lines
...
}Should the test also be checking the region count and returning early here, before we pass an invalid pointer to
damon_destroy_region()and corrupt the slab?
This is fixed by a later patch of this series.
Quoted 27 lines
[Severity: High]
This is a pre-existing issue, but I'm also concerned about silent allocation failures fromdamon_split_region_at()in core kernel paths.Looking at
damon_apply_min_nr_regions():mm/damon/core.c:damon_apply_min_nr_regions() {
...damon_for_each_target(t, ctx) { damon_for_each_region_safe(r, next, t) { while (damon_sz_region(r) > max_region_sz) { damon_split_region_at(t, r, max_region_sz); r = damon_next_region(r); } } }...
}If
damon_split_region_at()silently fails to allocate memory, it returns without splitting the region. The while loop then incorrectly advances r to the next region.If this allocation failure occurs on the last region in the list,
damon_next_region(r)will return the list head.
Quoted 6 lines
The loop condition
damon_sz_region(r)>max_region_szwill evaluate memory located before thedamon_targetstruct.If those garbage values evaluate to true, could this result in an out-of-bounds access loop or corrupt memory? Should
damon_split_region_at()return an error code that callers can check?
I'm separately working [1] on it.
[1] https://lore.kernel.org/[email protected]
Quoted 5 lines
[ ... ]
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Thanks,
SJ
SJ Park
maintainerPATCH 3/7 mm/damon/vaddr-kunit: check region count in three_regions test
In reply to SJ Parkdamon_do_test_apply_three_regions() iterates regions after damon_set_regions() call assuming the function would succeed at setting the number of regions the same to the expected one. It might have failed. In this case, __nth_region_of() in the iteration could return NULL and NULL dereference can happen in the test.
The consequent user impact (NULL dereference) is quite bad. The realistic user impact would be limited, though. It would affect only test run setups.
Fix it by testing if the number of regions was also changed as expected and exit early for the failure.
The issue was discovered [1] by Sashiko.
[1] https://lore.kernel.org/[email protected]
--- mm/damon/tests/vaddr-kunit.h | 5 +++++ 1 file changed, 5 insertions(+)
mm/damon/tests/vaddr-kunit.h +5 -0
@@ -158,12 +158,17 @@ static void damon_do_test_apply_three_regions(struct kunit *test,kunit_skip (test,"second damon_set_regions() fail" ); } +KUNIT_EXPECT_EQ (test,damon_nr_regions (t), nr_expected /2 ); +if (damon_nr_regions (t) != nr_expected /2 ) + goto out; +for (i =0 ; i < nr_expected /2 ; i++) { r =__nth_region_of (t, i);KUNIT_EXPECT_EQ (test, r->ar.start, expected[i *2 ]);KUNIT_EXPECT_EQ (test, r->ar.end, expected[i *2 +1 ]); } +out:damon_destroy_target (t,NULL ); }
Signature · 1 line
2.47.3
SJ Park
maintainerPATCH 4/7 mm/damon/core-kunit: handle region split failure in filter_out()
In reply to SJ Parkdasmon_test_filter_out() test checks if damos_filter_match() of an address filter splits the region as expected under a given condition. But, the test continued regardless of the split successes. As a result, the later part of the test could dereference invalid pointers that returned from damon_next_region(). Further, it could corrupt memory from damon_destroy_region().
The consequent user impact (memory corruption) is quite bad. The realistic user impact would be limited, though. It would affect only test run setups.
Fix it by exiting early for the number of regions test failure.
The issue was discovered [1] by Sashiko.
[1] https://lore.kernel.org/[email protected]
--- mm/damon/tests/core-kunit.h | 5 +++++ 1 file changed, 5 insertions(+)
mm/damon/tests/core-kunit.h +5 -0
@@ -1365,6 +1365,8 @@ static void damos_test_filter_out(struct kunit *test)KUNIT_EXPECT_EQ (test, r->ar.start,1 );KUNIT_EXPECT_EQ (test, r->ar.end,2 );KUNIT_EXPECT_EQ (test,damon_nr_regions (t),2 ); +if (damon_nr_regions (t) !=2 ) + goto out; r2 =damon_next_region (r);KUNIT_EXPECT_EQ (test, r2->ar.start,2 );KUNIT_EXPECT_EQ (test, r2->ar.end,4 );
@@ -1379,11 +1381,14 @@ static void damos_test_filter_out(struct kunit *test)KUNIT_EXPECT_EQ (test, r->ar.start,2 );KUNIT_EXPECT_EQ (test, r->ar.end,6 );KUNIT_EXPECT_EQ (test,damon_nr_regions (t),2 ); +if (damon_nr_regions (t) !=2 ) + goto out; r2 =damon_next_region (r);KUNIT_EXPECT_EQ (test, r2->ar.start,6 );KUNIT_EXPECT_EQ (test, r2->ar.end,8 );damon_destroy_region (r2, t); +out:damon_free_target (t);damos_free_filter (f); }
Signature · 1 line
2.47.3
[email protected]
AI reviewRe: [PATCH 4/7] mm/damon/core-kunit: handle region split failure in filter_out()
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] In damon_apply_min_nr_regions(), damon_split_regions_of(), and kdamond_split_regions(), if damon_split_region_at() fails to allocate memory for a new region, the loop variable r is still unconditionally advanced to the next region. This leads to iterating past the end of the region list, reading from out-of-bounds memory, and potentially causing memory corruption. --
--- Patch [4]: [PATCH 4/7] mm/damon/core-kunit: handle region split failure in filter_out() --- commit 8274c3713b297d606d32992612a8cbd24ac04759
Author: SJ Park <[email protected]>
mm/damon/core-kunit: handle region split failure in filter_out()
This commit modifies the kunit test damos_test_filter_out() to add early exit checks when damon_nr_regions() does not return the expected value. This prevents the test from dereferencing invalid pointers if damon_split_region_at() fails. It fixes memory corruption that could occur during test runs.
mm/damon/tests/core-kunit.h static void damos_test_filter_out(struct kunit *test) · line 1370
Quoted 11 lines
mm/damon/tests/core-kunit.h +2
-0@@ -1365,6 +1365,8 @@ static void damos_test_filter_out(struct kunit *test)KUNIT_EXPECT_EQ (test, r->ar.start,1 );KUNIT_EXPECT_EQ (test, r->ar.end,2 );KUNIT_EXPECT_EQ (test,damon_nr_regions (t),2 ); +if (damon_nr_regions (t) !=2 ) + goto out; r2 =damon_next_region (r);
[ ... ]
[Severity: High]
This is a pre-existing issue, but I noticed a similar pattern in mm/damon/core.c where damon_split_region_at() failures might not be handled safely.
In damon_apply_min_nr_regions():
mm/damon/core.c:damon_apply_min_nr_regions() {
...
while (damon_sz_region(r) > max_region_sz) {
damon_split_region_at(t, r, max_region_sz);
r = damon_next_region(r);
}
...
}If damon_split_region_at() fails to allocate memory due to memory pressure and silently returns, does the unconditional call to damon_next_region(r) advance past the end of the list?
If r was the last region in the target's list, could r become the list head and point to memory before the struct damon_target?
If so, the condition while (damon_sz_region(r) > max_region_sz) could read from out-of-bounds memory.
If the resulting garbage size exceeds max_region_sz, it might call damon_split_region_at() on the invalid pointer, which could then corrupt the heap by writing to r->ar.end.
The same pattern appears in damon_split_regions_of():
mm/damon/core.c:damon_split_regions_of() {
...
damon_split_region_at(t, r, sz_sub);
sz_region = sz_region - sz_sub;
r = damon_next_region(r);
...
}And also in kdamond_split_regions():
mm/damon/core.c:kdamond_split_regions() {
...
damon_split_region_at(t, r, sz_sub);
sz_region = sz_region - sz_sub;
r = damon_next_region(r);
...
}Can these paths also wrap around the list and cause out-of-bounds accesses during memory pressure in the kdamond thread?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
SJ Park
maintainerRe: [PATCH 4/7] mm/damon/core-kunit: handle region split failure in filter_out()
Quoted 56 lines · On Sat, 18 Jul 2026 00:29:09 +0000 [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Indamon_apply_min_nr_regions(),damon_split_regions_of(), andkdamond_split_regions(), ifdamon_split_region_at()fails to allocate memory for a new region, the loop variableris still unconditionally advanced to the next region. This leads to iterating past the end of the region list, reading from out-of-bounds memory, and potentially causing memory corruption. ----- Patch [4]: [PATCH 4/7]
mm/damon/core-kunit: handle region split failure infilter_out()--- commit8274c3713b297d606d32992612a8cbd24ac04759
Author: SJ Park <[email protected]>
mm/damon/core-kunit: handle region split failure infilter_out()This commit modifies the kunit test
damos_test_filter_out()to add early exit checks whendamon_nr_regions()does not return the expected value. This prevents the test from dereferencing invalid pointers ifdamon_split_region_at()fails. It fixes memory corruption that could occur during test runs.mm/damon/tests/core-kunit.h static void damos_test_filter_out(struct kunit *test) · line 1370
Quoted 11 lines
mm/damon/tests/core-kunit.h +2
-0@@ -1365,6 +1365,8 @@ static void damos_test_filter_out(struct kunit *test)KUNIT_EXPECT_EQ (test, r->ar.start,1 );KUNIT_EXPECT_EQ (test, r->ar.end,2 );KUNIT_EXPECT_EQ (test,damon_nr_regions (t),2 ); +if (damon_nr_regions (t) !=2 ) + goto out; r2 =damon_next_region (r);[ ... ]
[Severity: High]
This is a pre-existing issue, but I noticed a similar pattern inmm/damon/core.cwheredamon_split_region_at()failures might not be handled safely.In
damon_apply_min_nr_regions():mm/damon/core.c:damon_apply_min_nr_regions() { ... while (damon_sz_region(r) > max_region_sz) { damon_split_region_at(t, r, max_region_sz); r = damon_next_region(r); } ... }If
damon_split_region_at()fails to allocate memory due to memory pressure and silently returns, does the unconditional call todamon_next_region(r)advance past the end of the list?If
rwas the last region in the target's list, couldrbecome the list head and point to memory before the structdamon_target?
Quoted 6 lines
If so, the condition while (
damon_sz_region(r)>max_region_sz) could read from out-of-bounds memory.If the resulting garbage size exceeds
max_region_sz, it might calldamon_split_region_at()on the invalid pointer, which could then corrupt the heap by writing tor->ar.end.
Yes, I'm separately working [1] on it.
Quoted 21 lines
The same pattern appears in
damon_split_regions_of():mm/damon/core.c:damon_split_regions_of() { ... damon_split_region_at(t, r, sz_sub); sz_region = sz_region - sz_sub; r = damon_next_region(r); ... }And also in
kdamond_split_regions():mm/damon/core.c:kdamond_split_regions() { ... damon_split_region_at(t, r, sz_sub); sz_region = sz_region - sz_sub; r = damon_next_region(r); ... }
Quoted 2 lines
Can these paths also wrap around the list and cause out-of-bounds accesses during memory pressure in the kdamond thread?
No, the above two cases are hallucinations. The example code snippet is different from the real ones.
Quoted 3 lines
Signature · 2 lines
-- Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
[1] https://lore.kernel.org/[email protected]
Thanks,
SJ
SJ Park
maintainerPATCH 5/7 mm/damon/core-kunit: skip wrong dest walk in commit_dests_for()
In reply to SJ Parkdamos_test_commit_dests_for() traverse damos action destinations after damos_commit_dests(). It assumes damos_commit_dests() made expected numbers of destinations for source and destination structures. It might not. Because the traversal is made based on destination struct length, it could do out of bounds access for source value expectation.
The consequent user impact (out-of-bound access ) is quite bad. The realistic user impact would be limited, though. It would affect only test run setups.
Fix it by exiting early for the number of regions test failure.
The issue was discovered [1] by Sashiko.
[1] https://lore.kernel.org/[email protected]
--- mm/damon/tests/core-kunit.h | 2 ++ 1 file changed, 2 insertions(+)
mm/damon/tests/core-kunit.h +2 -0
@@ -1008,6 +1008,8 @@ static void damos_test_commit_dests_for(struct kunit *test, skip = false;KUNIT_EXPECT_EQ (test, dst.nr_dests, src_nr_dests); +if (dst.nr_dests != src_nr_dests) + goto out;for (i =0 ; i < dst.nr_dests; i++) {KUNIT_EXPECT_EQ (test, dst.node_id_arr[i], src_node_id_arr[i]);KUNIT_EXPECT_EQ (test, dst.weight_arr[i], src_weight_arr[i]);
Signature · 1 line
2.47.3
[email protected]
AI reviewRe: [PATCH 5/7] mm/damon/core-kunit: skip wrong dest walk in commit_dests_for()
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] If damos_commit_dests() fails to allocate the weight_arr array, it returns -ENOMEM but leaves the dst context partially modified with a NULL weight_arr and an incorrect nr_dests, leading to a NULL pointer dereference during DAMOS scheme execution.
- [Medium] Missing out-of-bounds array bounds checks in the test functions damos_test_commit_quota_goals_for() and damon_test_commit_target_regions_for() when iterating over tested items.
--
--- Patch [5]: [PATCH 5/7] mm/damon/core-kunit: skip wrong dest walk in commit_dests_for() --- commit 937f902e215bffeba8d97bcc0725b5bfbb643c41
Author: SJ Park <[email protected]>
Subject: mm/damon/core-kunit: skip wrong dest walk in commit_dests_for()
This patch fixes a potential out-of-bounds access in the KUnit tests for damos_commit_dests(). It exits early in damos_test_commit_dests_for() if the expected number of destinations does not match the actual number.
mm/damon/tests/core-kunit.h static void damos_test_commit_dests_for(struct kunit *test, · line 1012
Quoted 10 lines
mm/damon/tests/core-kunit.h +2
-0@@ -1008,6 +1008,8 @@ static void damos_test_commit_dests_for(struct kunit *test, skip = false;KUNIT_EXPECT_EQ (test, dst.nr_dests, src_nr_dests); +if (dst.nr_dests != src_nr_dests) + goto out;
[Severity: High]
This isn't a bug introduced by this patch, but looking at the function being tested, could damos_commit_dests() leave the destination context in a corrupted state on allocation failure?
If kmalloc_array() fails to allocate weight_arr, it returns -ENOMEM but leaves dst->weight_arr as NULL without resetting dst->nr_dests:
mm/damon/core.c:damos_commit_dests() {
...
dst->weight_arr = kmalloc_array(src->nr_dests,
sizeof(*dst->weight_arr), GFP_KERNEL);
if (!dst->weight_arr) {
/* ->node_id_arr will be freed by scheme destruction */
return -ENOMEM;
}
}
...
}Would a subsequent execution in damos_va_migrate_dests_add() dereference this NULL array when iterating over dst->nr_dests, leading to a system crash?
[Severity: Medium]
This is a pre-existing issue, but does the same out-of-bounds array access vulnerability exist in other test functions in this file?
Similar to the fix applied here, the loops in damos_test_commit_quota_goals_for() and damon_test_commit_target_regions_for() iterate over items without bounds checking, only verifying the length after the loop completes.
For example, in damos_test_commit_quota_goals_for():
mm/damon/tests/core-kunit.h:damos_test_commit_quota_goals_for() {
...
damos_for_each_quota_goal(goal, &dst->quota) {
KUNIT_EXPECT_EQ(test, goal->metric, src_goals[i].metric);
...
}
...
}Could these loops exceed the bounds of arrays like src_goals[] or expect_start_end[] if the tested function produces more elements than expected?
Quoted 3 lines
mm/damon/tests/core-kunit.h +0
-0for (i =0 ; i < dst.nr_dests; i++) {KUNIT_EXPECT_EQ (test, dst.node_id_arr[i], src_node_id_arr[i]);KUNIT_EXPECT_EQ (test, dst.weight_arr[i], src_weight_arr[i]);
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
SJ Park
maintainerRe: [PATCH 5/7] mm/damon/core-kunit: skip wrong dest walk in commit_dests_for()
Quoted 49 lines · On Sat, 18 Jul 2026 00:25:43 +0000 [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Ifdamos_commit_dests()fails to allocate theweight_arrarray, it returns-ENOMEMbut leaves thedstcontext partially modified with a NULLweight_arrand an incorrectnr_dests, leading to a NULL pointer dereference during DAMOS scheme execution.
- [Medium] Missing out-of-bounds array bounds checks in the test functionsdamos_test_commit_quota_goals_for()anddamon_test_commit_target_regions_for()when iterating over tested items.
----- Patch [5]: [PATCH 5/7]
mm/damon/core-kunit: skip wrong dest walk incommit_dests_for()--- commit937f902e215bffeba8d97bcc0725b5bfbb643c41
Author: SJ Park <[email protected]>
Subject:mm/damon/core-kunit: skip wrong dest walk incommit_dests_for()This patch fixes a potential out-of-bounds access in the KUnit tests for
damos_commit_dests(). It exits early indamos_test_commit_dests_for()if the expected number of destinations does not match the actual number.mm/damon/tests/core-kunit.h static void damos_test_commit_dests_for(struct kunit *test, · line 1012
Quoted 10 lines
mm/damon/tests/core-kunit.h +2
-0@@ -1008,6 +1008,8 @@ static void damos_test_commit_dests_for(struct kunit *test, skip = false;KUNIT_EXPECT_EQ (test, dst.nr_dests, src_nr_dests); +if (dst.nr_dests != src_nr_dests) + goto out;[Severity: High]
This isn't a bug introduced by this patch, but looking at the function being tested, coulddamos_commit_dests()leave the destination context in a corrupted state on allocation failure?If
kmalloc_array()fails to allocateweight_arr, it returns-ENOMEMbut leavesdst->weight_arras NULL without resettingdst->nr_dests:mm/damon/core.c:damos_commit_dests() { ... dst->weight_arr = kmalloc_array(src->nr_dests, sizeof(*dst->weight_arr), GFP_KERNEL); if (!dst->weight_arr) { /* ->node_id_arr will be freed by scheme destruction */ return -ENOMEM; } } ... }
Quoted 2 lines
Would a subsequent execution in
damos_va_migrate_dests_add()dereference this NULL array when iterating overdst->nr_dests, leading to a system crash?
Yes, and another patch in this series fixes it.
Quoted 21 lines
[Severity: Medium]
This is a pre-existing issue, but does the same out-of-bounds array access vulnerability exist in other test functions in this file?Similar to the fix applied here, the loops in
damos_test_commit_quota_goals_for()anddamon_test_commit_target_regions_for()iterate over items without bounds checking, only verifying the length after the loop completes.For example, in
damos_test_commit_quota_goals_for():mm/damon/tests/core-kunit.h:damos_test_commit_quota_goals_for() { ... damos_for_each_quota_goal(goal, &dst->quota) { KUNIT_EXPECT_EQ(test, goal->metric, src_goals[i].metric); ... } ... }
Quoted 3 lines
Could these loops exceed the bounds of arrays like src_goals[] or expect_start_end[] if the tested function produces more elements than expected?
Yes, and another patch in this series fixes it.
Quoted 7 lines
Quoted 4 lines
mm/damon/tests/core-kunit.h +0
-0for (i =0 ; i < dst.nr_dests; i++) {KUNIT_EXPECT_EQ (test, dst.node_id_arr[i], src_node_id_arr[i]);KUNIT_EXPECT_EQ (test, dst.weight_arr[i], src_weight_arr[i]);Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
Thanks,
SJ
SJ Park
maintainerPATCH 6/7 mm/damon/core-kunit: skip wrong quota goal walk in commit_quota_goals()
In reply to SJ Parkdamos_test_commit_quota_goals_for() traverses damos quota goals after damos_commit_quota_goals() call. It assumes damos_commit_quota_goals() made expected numbers of goals. It might not. Because the traversal is made based on destination struct length, it could do out of bounds access for source expectation value array.
The consequent user impact (out-of-bound access ) is quite bad. The realistic user impact would be limited though. It would affect only test run setups.
Fix it by testing if the number of goals was also changed as expected and exit early for the failure.
The issue was discovered [1] by Sashiko.
[1] https://lore.kernel.org/[email protected]
--- mm/damon/tests/core-kunit.h | 9 +++++++++ 1 file changed, 9 insertions(+)
mm/damon/tests/core-kunit.h +9 -0
@@ -839,6 +839,7 @@ static void damos_test_commit_quota_goals_for(struct kunit *test,struct damos_quota_goal *goal, *next;bool skip = true;int i; +int nr_dst =0 , nr_src =0 ;INIT_LIST_HEAD (&dst.goals);INIT_LIST_HEAD (&src.goals);
@@ -861,6 +862,14 @@ static void damos_test_commit_quota_goals_for(struct kunit *test,damos_commit_quota_goals (&dst, &src); +damos_for_each_quota_goal (goal, &dst) + nr_dst++; +damos_for_each_quota_goal (goal, &src) + nr_src++; +KUNIT_EXPECT_EQ (test, nr_dst, nr_src); +if (nr_dst != nr_src) + goto out; + i =0 ;damos_for_each_quota_goal (goal, (&dst)) {KUNIT_EXPECT_EQ (test, goal->metric, src_goals[i].metric);
Signature · 1 line
2.47.3
[email protected]
AI reviewRe: [PATCH 6/7] mm/damon/core-kunit: skip wrong quota goal walk in commit_quota_goals()
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [Medium] Out-of-bounds array read in damon_test_commit_target_regions_for() due to missing region count validation before traversing dst_target. --
--- Patch [6]: [PATCH 6/7] mm/damon/core-kunit: skip wrong quota goal walk in commit_quota_goals() --- commit 4bcb5123bbb5f6b4908f1d776a8608ef05a89501
Author: SJ Park <[email protected]>
Subject: mm/damon/core-kunit: skip wrong quota goal walk in commit_quota_goals()
This commit addresses an out-of-bounds array access in the KUnit test damos_test_commit_quota_goals_for(). If the number of created quota goals does not match the expected count, blindly traversing them can cause the test to read past the bounds of the expected values array. The patch adds a count validation and an early exit to avoid this invalid traversal.
Quoted 9 lines
mm/damon/tests/core-kunit.h +1
-0@@ -861,6 +862,14 @@ static void damos_test_commit_quota_goals_for(struct kunit *test,damos_commit_quota_goals (&dst, &src); +damos_for_each_quota_goal (goal, &dst)
mm/damon/tests/core-kunit.h static void damos_test_commit_quota_goals_for(struct kunit *test, · line 875
Quoted 10 lines
mm/damon/tests/core-kunit.h +7
-0+ nr_dst++; +damos_for_each_quota_goal (goal, &src) + nr_src++; +KUNIT_EXPECT_EQ (test, nr_dst, nr_src); +if (nr_dst != nr_src) + goto out; + i =0 ;damos_for_each_quota_goal (goal, (&dst)) {KUNIT_EXPECT_EQ (test, goal->metric, src_goals[i].metric);
[Severity: Medium]
This isn't a bug introduced by this patch, but should a similar early exit check be added to damon_test_commit_target_regions_for() to prevent an out-of-bounds read?
Just like the issue fixed here, damon_test_commit_target_regions_for() iterates over dst_target regions without validating the region count against nr_expect_regions first:
mm/damon/tests/core-kunit.h:damon_test_commit_target_regions_for() {
...
damon_commit_target_regions(dst_target, src_target, 1);
i = 0;
damon_for_each_region(r, dst_target) {
KUNIT_EXPECT_EQ(test, r->ar.start, expect_start_end[i][0]);
KUNIT_EXPECT_EQ(test, r->ar.end, expect_start_end[i][1]);
i++;
}
KUNIT_EXPECT_EQ(test, damon_nr_regions(dst_target), nr_expect_regions);
...
}If damon_commit_target_regions() incorrectly leaves more regions in dst_target than nr_expect_regions, the loop will read past the end of the expect_start_end[] array before reaching the KUNIT_EXPECT_EQ count validation at the end of the function.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
SJ Park
maintainerRe: [PATCH 6/7] mm/damon/core-kunit: skip wrong quota goal walk in commit_quota_goals()
Quoted 61 lines · On Sat, 18 Jul 2026 00:22:57 +0000 [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [Medium] Out-of-bounds array read indamon_test_commit_target_regions_for()due to missing region count validation before traversingdst_target. ----- Patch [6]: [PATCH 6/7]
mm/damon/core-kunit: skip wrong quota goal walk incommit_quota_goals()--- commit4bcb5123bbb5f6b4908f1d776a8608ef05a89501
Author: SJ Park <[email protected]>
Subject:mm/damon/core-kunit: skip wrong quota goal walk incommit_quota_goals()This commit addresses an out-of-bounds array access in the KUnit test
damos_test_commit_quota_goals_for(). If the number of created quota goals does not match the expected count, blindly traversing them can cause the test to read past the bounds of the expected values array. The patch adds a count validation and an early exit to avoid this invalid traversal.Quoted 9 lines
mm/damon/tests/core-kunit.h +1
-0@@ -861,6 +862,14 @@ static void damos_test_commit_quota_goals_for(struct kunit *test,damos_commit_quota_goals (&dst, &src); +damos_for_each_quota_goal (goal, &dst)mm/damon/tests/core-kunit.h static void damos_test_commit_quota_goals_for(struct kunit *test, · line 875
Quoted 10 lines
mm/damon/tests/core-kunit.h +7
-0+ nr_dst++; +damos_for_each_quota_goal (goal, &src) + nr_src++; +KUNIT_EXPECT_EQ (test, nr_dst, nr_src); +if (nr_dst != nr_src) + goto out; + i =0 ;damos_for_each_quota_goal (goal, (&dst)) {KUNIT_EXPECT_EQ (test, goal->metric, src_goals[i].metric);[Severity: Medium]
This isn't a bug introduced by this patch, but should a similar early exit check be added todamon_test_commit_target_regions_for()to prevent an out-of-bounds read?Just like the issue fixed here,
damon_test_commit_target_regions_for()iterates overdst_targetregions without validating the region count againstnr_expect_regionsfirst:mm/damon/tests/core-kunit.h:damon_test_commit_target_regions_for() { ... damon_commit_target_regions(dst_target, src_target, 1); i = 0; damon_for_each_region(r, dst_target) { KUNIT_EXPECT_EQ(test, r->ar.start, expect_start_end[i][0]); KUNIT_EXPECT_EQ(test, r->ar.end, expect_start_end[i][1]); i++; } KUNIT_EXPECT_EQ(test, damon_nr_regions(dst_target), nr_expect_regions); ... }
Quoted 4 lines
If
damon_commit_target_regions()incorrectly leaves more regions indst_targetthannr_expect_regions, the loop will read past the end of the expect_start_end[] array before reaching theKUNIT_EXPECT_EQcount validation at the end of the function.
Yes, and another patch in this series fixes it.
Quoted 3 lines
Signature · 2 lines
-- Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
Thanks,
SJ
SJ Park
maintainerPATCH 7/7 mm/damon/core-kunit: skip wrong region walk in commit_target_regions()
In reply to SJ Parkdamon_test_commit_target_regions_for() traverses expected values array after damon_commit_target_regions() call. It assumes damon_commit_target_regions() made expected number of regions. It might not. Because the traversal is made based on the region count, it could do out of bounds access to the expectation value array.
The consequent user impact (out-of-bound access) is quite bad. The realistic user impact would be limited, though. It would affect only test run setups.
Fix it by testing if the number of regions was also changed as expected and exit early for the failure.
The issue was discovered [1] by Sashiko.
[1] https://lore.kernel.org/[email protected]
--- mm/damon/tests/core-kunit.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
mm/damon/tests/core-kunit.h +7 -2
@@ -1277,14 +1277,19 @@ static void damon_test_commit_target_regions_for(struct kunit *test,kunit_skip (test,"src target setup fail" ); }damon_commit_target_regions (dst_target, src_target,1 ); + +KUNIT_EXPECT_EQ (test,damon_nr_regions (dst_target), nr_expect_regions); +if (damon_nr_regions (dst_target) != nr_expect_regions) + goto out; + i =0 ;damon_for_each_region (r, dst_target) {KUNIT_EXPECT_EQ (test, r->ar.start, expect_start_end[i][0 ]);KUNIT_EXPECT_EQ (test, r->ar.end, expect_start_end[i][1 ]); i++; } -KUNIT_EXPECT_EQ (test,damon_nr_regions (dst_target), nr_expect_regions); -KUNIT_EXPECT_EQ (test, i, nr_expect_regions); + +out:damon_free_target (dst_target);damon_free_target (src_target); }
Signature · 1 line
2.47.3
SJ Park
maintainerQuoted 3 lines · On Fri, 17 Jul 2026 17:14:34 -0700 SJ Park <[email protected]> wrote:
Fix a few Sashiko-found unurgent bugs. Patch 1 fixes use of uninitialized
damos->last_appliedfield. Patches 2-7 fix DAMON kunit tests that do invalid memory access under test failures.
Sashiko found no blocker for this series. Sashiko sent findings to damon@ mailing list [1], and I replied to all the comments. Please read those for details.
[1] https://lore.kernel.org/damon/
Thanks,
SJ
[...]