mm/damon: move damos filter range arguments validation to core
Status from this message: [merged mm-stable] mm-damon-core-kunit-test-invalid-damos-filter-commits.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first
Changes from RFC v2 from the cover letter
- RFC v2: https://lore.kernel.org/[email protected]
- Drop RFC tag.
- Rebase to latest mm-new.
Changes from RFC
- RFC: https://lore.kernel.org/[email protected]
- Handle error from damos_commit_filter_arg() on all call sites.
Patches in v1 All 8 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | mm/damon/sysfs-schemes: read sysfs_filter->addr_range only oncemm/ | +3 | 0 replies | Applied |
| 2/8 | mm/damon/sysfs-schemes: read sysfs_filter->sz_range only oncemm/ | +3 | 0 replies | Applied |
| 3/8 | mm/damon/core: return an error from damos_commit_filter_arg()mm/ | +28 | 0 replies | Applied |
| 4/8 | mm/damon/core: disallow max < min damos filter range arguments commitmm/ | +6 | 0 replies | Applied |
| 5/8 | mm/damon/sysfs-schemes: drop centralized filter range arg validationsmm/ | +0 | 0 replies | Applied |
| 6/8 | mm/damon/sysfs-schemes: use switch-case in add_scheme_filters()mm/ | +13 | 0 replies | Applied |
| 7/8 | mm/damon/core-kunit: extend damos_commit_filter_for() for wrong inputmm/ | +15 | 0 replies | Applied |
| 8/8 | mm/damon/core-kunit: test invalid damos filter commitsmm/ | +14 | 1 reply | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/8] mm/damon: move damos filter range arguments validation to core
DAMOS filter range arguments are being validated in the DAMON sysfs interface. Some of those have minor time-of-check to time-of-use (TOCTOU) bugs. In future, other callers might have duplicated validations with similar bugs.
Fix the bugs and further refactor the code to move the validation to the core layer. Also add kunit test cases for the validations.
Patches 1 and 2 fix the existing TOCTOU bugs. Patches 3 and 4 adds the validation in the core layer. Patch 5 drops the replicated validation in DAMON sysfs interface. Patch 6 further cleanup the code. Patches 7 and 8 extends kunit tests to test the validation.
Changes from RFC v2
- RFC v2: https://lore.kernel.org/[email protected]
- Drop RFC tag.
- Rebase to latest mm-new.
Changes from RFC
- RFC: https://lore.kernel.org/[email protected]
- Handle error from damos_commit_filter_arg() on all call sites.
SJ Park (8):
mm/damon/sysfs-schemes: read sysfs_filter->addr_range only once mm/damon/sysfs-schemes: read sysfs_filter->sz_range only once mm/damon/core: return an error from damos_commit_filter_arg() mm/damon/core: disallow max < min damos filter range arguments commit mm/damon/sysfs-schemes: drop centralized filter range arg validations mm/damon/sysfs-schemes: use switch-case in add_scheme_filters() mm/damon/core-kunit: extend damos_commit_filter_for() for wrong input mm/damon/core-kunit: test invalid damos filter commits
mm/damon/core.c | 47 +++++++++++++++++++++++++++---------- mm/damon/sysfs-schemes.c | 32 ++++++++++--------------- mm/damon/tests/core-kunit.h | 38 +++++++++++++++++++++++------- 3 files changed, 76 insertions(+), 41 deletions(-)
base-commit: 5e38c61dbb4349ff7e900d97d96f369c64678eea
Signature · 1 line
2.47.3