The patch titled Subject: mm/damon/sysfs: fix out-of-bound array access for wmark_metric_strs[] has been removed from the -mm tree. Its filename was mm-damon-sysfs-support-damos-watermarks-fix.patch This patch was dropped because it was folded into mm-damon-sysfs-support-damos-watermarks.patch ------------------------------------------------------ From: SeongJae Park <sj@xxxxxxxxxx> Subject: mm/damon/sysfs: fix out-of-bound array access for wmark_metric_strs[] Commit 7a8630be880e ("mm/damon/sysfs: support DAMOS watermarks") on -mm tree which introduced by a patch[1] titled mm-damon-sysfs-support-damos-watermarks.patch allows out-of-bound access to damon_sysfs_wmark_metric_strs[] array due to wrong bound check. This commit fixes the wrong bound check. The issue has found by Coverity report for linux-next. [1] https://www.ozlabs.org/~akpm/mmotm/broken-out/mm-damon-sysfs-support-damos-watermarks.patch Addresses-Coverity: ("Out-of-bounds read") Link: https://lkml.kernel.org/r/20220301185619.2904-1-sj@xxxxxxxxxx Fixes: 7a8630be880e ("mm/damon/sysfs: support DAMOS watermarks") Signed-off-by: SeongJae Park <sj@xxxxxxxxxx> Cc: Colin Ian King <colin.i.king@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/damon/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/damon/sysfs.c~mm-damon-sysfs-support-damos-watermarks-fix +++ a/mm/damon/sysfs.c @@ -167,7 +167,7 @@ static ssize_t metric_store(struct kobje struct damon_sysfs_watermarks, kobj); enum damos_wmark_metric metric; - for (metric = 0; metric <= NR_DAMOS_WMARK_METRICS; metric++) { + for (metric = 0; metric < NR_DAMOS_WMARK_METRICS; metric++) { if (sysfs_streq(buf, damon_sysfs_wmark_metric_strs[metric])) { watermarks->metric = metric; return count; _ Patches currently in -mm which might be from sj@xxxxxxxxxx are mm-damon-dbgfs-init_regions-use-target-index-instead-of-target-id.patch docs-admin-guide-mm-damon-usage-update-for-changed-initail_regions-file-input.patch mm-damon-core-move-damon_set_targets-into-dbgfs.patch mm-damon-remove-the-target-id-concept.patch mm-damon-rename-damon_primitives-to-damon_operations.patch mm-damon-let-monitoring-operations-can-be-registered-and-selected.patch mm-damon-paddrvaddr-register-themselves-to-damon-in-subsys_initcall.patch mm-damon-reclaim-use-damon_select_ops-instead-of-damon_vpa_set_operations.patch mm-damon-dbgfs-use-damon_select_ops-instead-of-damon_vpa_set_operations.patch mm-damon-dbgfs-use-operations-id-for-knowing-if-the-target-has-pid.patch mm-damon-dbgfs-test-fix-is_target_id-change.patch mm-damon-paddrvaddr-remove-damon_pva_target_validset_operations.patch docs-vm-damon-call-low-level-monitoring-primitives-the-operations.patch docs-vm-damon-design-update-damon-idle-page-tracking-interference-handling.patch docs-damon-update-outdated-term-regions-update-interval.patch mm-damon-core-allow-non-exclusive-damon-start-stop.patch mm-damon-core-add-number-of-each-enum-type-values.patch mm-damon-implement-a-minimal-stub-for-sysfs-based-damon-interface.patch mm-damon-sysfs-link-damon-for-virtual-address-spaces-monitoring.patch mm-damon-sysfs-support-the-physical-address-space-monitoring.patch mm-damon-sysfs-support-damon-based-operation-schemes.patch mm-damon-sysfs-support-damos-quotas.patch mm-damon-sysfs-support-schemes-prioritization.patch mm-damon-sysfs-support-damos-watermarks.patch mm-damon-sysfs-support-damos-stats.patch selftests-damon-add-a-test-for-damon-sysfs-interface.patch docs-admin-guide-mm-damon-usage-document-damon-sysfs-interface.patch docs-abi-testing-add-damon-sysfs-interface-abi-document.patch