Skip to content

mm/damon: unurgent fixes for infinite loop, NULL de-ref and races

SJ Park damon linux-kselftest linux-mm lkml stable 1 version Applied

Status from this message: [merged mm-stable] mm-damon-sysfs-read-ops_id-only-once-in-damon_sysfs_apply_inputs.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 4 repliesApplied 6/6

Changes from v1 from the cover letter

- v1: https://lore.kernel.org/[email protected]
- Add addr_unit race fix.
- Add Fixes: tags to the race fixes.
- Wordsmith subjects.
Changes from RFC v1.2
- RFC v1.2: https://lore.kernel.org/[email protected]
- Drop RFC tag.
- Rebase to latest mm-new.
Changes from RFC v1.1
- RFC v1.1: https://lore.kernel.org/[email protected]
- Remove same_target param from __damon_va_check_access(). Changes from RFC
- RFC: https://lore.kernel.org/[email protected]
- Rebase to mm-new.

Patches in v1 All 6 applied

#Subject and filesSizeRepliesApplied
1/6mm/damon/core: avoid infinite kdamond_merge_regions() internal loopmm/damon/core.c+9 -40 repliesApplied
2/6mm/damon/tests/core-kunit: catch test failure in test_merge_regions_of()mm/damon/tests/core-kunit.h+3 -01 replyApplied
3/6mm/damon/vaddr: drop last same folio access check optimizationmm/damon/vaddr.c+6 -270 repliesApplied
4/6mm/damon/paddr: drop last same folio access check reuse optimizationmm/damon/paddr.c+4 -160 repliesApplied
5/6mm/damon/sysfs: read addr_unit only once in damon_sysfs_apply_inputs()mm/damon/sysfs.c+2 -20 repliesApplied
6/6mm/damon/sysfs: read ops_id only once in damon_sysfs_apply_inputs()mm/damon/sysfs.c+4 -20 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH v1.1 0/6] mm/damon: unurgent fixes for infinite loop, NULL de-ref and races

Sashiko found a few issues in DAMON that could cause infinite loop, NULL dereference and monitoring results degradation. The first two sounds scary but the infinite loop happens only under unreasonable user setup. The NULL dereference is only in a unit test. Monitoring results degradation is trivial since it is only best-effort, and those happens from only unlikely races. Still those are bugs that better to fix if possible. Fix those.

Changes from v1
- v1: https://lore.kernel.org/[email protected]
- Add addr_unit race fix.
- Add Fixes: tags to the race fixes.
- Wordsmith subjects.
Changes from RFC v1.2
- RFC v1.2: https://lore.kernel.org/[email protected]
- Drop RFC tag.
- Rebase to latest mm-new.
Changes from RFC v1.1
- RFC v1.1: https://lore.kernel.org/[email protected]
- Remove same_target param from __damon_va_check_access(). Changes from RFC
- RFC: https://lore.kernel.org/[email protected]
- Rebase to mm-new.

SJ Park (6):
mm/damon/core: avoid infinite kdamond_merge_regions() internal loop mm/damon/tests/core-kunit: catch test failure in
test_merge_regions_of()
mm/damon/vaddr: drop last same folio access check optimization mm/damon/paddr: drop last same folio access check reuse optimization mm/damon/sysfs: read addr_unit only once in damon_sysfs_apply_inputs() mm/damon/sysfs: read ops_id only once in damon_sysfs_apply_inputs()

 mm/damon/core.c             | 13 +++++++++----
 mm/damon/paddr.c            | 20 ++++----------------
 mm/damon/sysfs.c            | 10 ++++++----
 mm/damon/tests/core-kunit.h |  3 +++
 mm/damon/vaddr.c            | 33 ++++++---------------------------
 5 files changed, 28 insertions(+), 51 deletions(-)

base-commit: 52d335d2c1de60b6184b9de5ecec634892a3e136

Signature · 1 line
2.47.3