[RFC PATCH 0/2] mm/damon: void divide-by-zero in DAMON module's parameters application

Quanmin Yan posted 2 patches 1 month, 1 week ago
There is a newer version of this series
mm/damon/lru_sort.c | 5 +++++
mm/damon/reclaim.c  | 5 +++++
2 files changed, 10 insertions(+)
[RFC PATCH 0/2] mm/damon: void divide-by-zero in DAMON module's parameters application
Posted by Quanmin Yan 1 month, 1 week ago
DAMON's RECLAIM or LRU_SORT modules perform no validation on
user-configured parameters during application, which may lead
to division-by-zero errors.

Avoid the divide-by-zero by adding validation checks when DAMON
modules attempt to apply the parameters.

Quanmin Yan (2):
  mm/damon/lru_sort: avoid divide-by-zero in
    damon_lru_sort_apply_parameters()
  mm/damon/reclaim: avoid divide-by-zero in
    damon_reclaim_apply_parameters()

 mm/damon/lru_sort.c | 5 +++++
 mm/damon/reclaim.c  | 5 +++++
 2 files changed, 10 insertions(+)

-- 
2.43.0
Re: [RFC PATCH 0/2] mm/damon: void divide-by-zero in DAMON module's parameters application
Posted by SeongJae Park 1 month, 1 week ago
On Tue, 26 Aug 2025 11:36:51 +0800 Quanmin Yan <yanquanmin1@huawei.com> wrote:

> DAMON's RECLAIM or LRU_SORT modules perform no validation on
> user-configured parameters during application, which may lead
> to division-by-zero errors.
> 
> Avoid the divide-by-zero by adding validation checks when DAMON
> modules attempt to apply the parameters.

Thank you for finding and fixing these problems, Quanmin!  All looks good,
though I think it would be better to add 'Cc: stable@' tags to each patch.


Thanks,
SJ

[...]