linux-yocto/mm/damon
Quanmin Yan 5d6eeb3c68 mm/damon/reclaim: avoid divide-by-zero in damon_reclaim_apply_parameters()
commit e6b543ca9806d7bced863f43020e016ee996c057 upstream.

When creating a new scheme of DAMON_RECLAIM, the calculation of
'min_age_region' uses 'aggr_interval' as the divisor, which may lead to
division-by-zero errors.  Fix it by directly returning -EINVAL when such a
case occurs.

Link: https://lkml.kernel.org/r/20250827115858.1186261-3-yanquanmin1@huawei.com
Fixes: f5a79d7c0c ("mm/damon: introduce struct damos_access_pattern")
Signed-off-by: Quanmin Yan <yanquanmin1@huawei.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: ze zuo <zuoze1@huawei.com>
Cc: <stable@vger.kernel.org>	[6.1+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-09-19 16:35:47 +02:00
..
tests mm/damon/vaddr: fix issue in damon_va_evenly_split_region() 2024-12-09 10:41:02 +01:00
core.c mm/damon/core: set quota->charged_from to jiffies at first charge window 2025-09-19 16:35:46 +02:00
dbgfs.c mm/damon: move kunit tests to tests/ subdirectory with _kunit suffix 2024-09-03 21:15:58 -07:00
Kconfig mm/damon/Kconfig: update DAMON doc URL 2024-09-26 14:01:44 -07:00
lru_sort.c mm/damon/lru_sort: avoid divide-by-zero in damon_lru_sort_apply_parameters() 2025-09-19 16:35:46 +02:00
Makefile
modules-common.c
modules-common.h
ops-common.c mm/damon/ops: have damon_get_folio return folio even for tail pages 2025-04-20 10:15:48 +02:00
ops-common.h
paddr.c mm/damon/ops-common: ignore migration request to invalid nodes 2025-08-28 16:31:03 +02:00
reclaim.c mm/damon/reclaim: avoid divide-by-zero in damon_reclaim_apply_parameters() 2025-09-19 16:35:47 +02:00
sysfs-common.c
sysfs-common.h
sysfs-schemes.c mm/damon/sysfs-schemes: free old damon_sysfs_scheme_filter->memcg_path on write 2025-07-06 11:01:38 +02:00
sysfs.c mm/damon/sysfs: fix use-after-free in state_show() 2025-09-19 16:35:47 +02:00
vaddr.c mm/damon/vaddr: fix issue in damon_va_evenly_split_region() 2024-12-09 10:41:02 +01:00