linux-stable/mm/damon
Kefeng Wang 2b179d3e9e mm/damon/core: fix divide error in damon_nr_accesses_to_accesses_bp()
commit 5ff6e2fff8 upstream.

If 'aggr_interval' is smaller than 'sample_interval', max_nr_accesses in
damon_nr_accesses_to_accesses_bp() becomes zero which leads to divide
error, let's validate the values of them in damon_set_attrs() to fix it,
which similar to others attrs check.

Link: https://lkml.kernel.org/r/20230527032101.167788-1-wangkefeng.wang@huawei.com
Fixes: 2f5bef5a59 ("mm/damon/core: update monitoring results for new monitoring attributes")
Reported-by: syzbot+841a46899768ec7bec67@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=841a46899768ec7bec67
Link: https://lore.kernel.org/damon/00000000000055fc4e05fc975bc2@google.com/
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-21 16:02:08 +02:00
..
Kconfig mm/damon/Kconfig: add DAMON debugfs interface deprecation notice 2023-02-13 15:54:32 -08:00
Makefile mm/damon/modules: deduplicate init steps for DAMON context setup 2022-11-30 15:01:26 -08:00
core-test.h mm/damon/core-test: add a test for damon_update_monitoring_results() 2023-02-02 22:33:26 -08:00
core.c mm/damon/core: fix divide error in damon_nr_accesses_to_accesses_bp() 2023-06-21 16:02:08 +02:00
dbgfs-test.h mm/damon/dbgfs-test: fix is_target_id() change 2022-03-22 15:57:12 -07:00
dbgfs.c mm/damon/dbgfs: print DAMON debugfs interface deprecation message 2023-02-13 15:54:33 -08:00
lru_sort.c mm/damon: use kstrtobool() instead of strtobool() 2022-11-30 15:58:45 -08:00
modules-common.c mm/damon/modules: deduplicate init steps for DAMON context setup 2022-11-30 15:01:26 -08:00
modules-common.h mm/damon/modules: deduplicate init steps for DAMON context setup 2022-11-30 15:01:26 -08:00
ops-common.c mm/damon: convert damon_ptep/pmdp_mkold() to use a folio 2023-01-18 17:12:52 -08:00
ops-common.h mm/damon: remove unneeded damon_get_page() 2023-01-18 17:12:53 -08:00
paddr.c mm/damon/paddr: fix folio_nr_pages() after folio_put() in damon_pa_mark_accessed_or_deactivate() 2023-03-07 17:04:55 -08:00
reclaim.c mm/damon/reclaim: add a parameter called skip_anon for avoiding anonymous pages reclamation 2023-01-18 17:12:43 -08:00
sysfs-common.c mm/damon/sysfs: make kobj_type structures constant 2023-02-09 16:51:45 -08:00
sysfs-common.h mm/damon/sysfs: make kobj_type structures constant 2023-02-09 16:51:45 -08:00
sysfs-schemes.c mm/damon/sysfs: make kobj_type structures constant 2023-02-09 16:51:45 -08:00
sysfs.c mm/damon/sysfs: make kobj_type structures constant 2023-02-09 16:51:45 -08:00
vaddr-test.h mm/damon/vaddr-test.h: stop using vma_mas_store() for maple tree store 2023-02-09 16:51:35 -08:00
vaddr.c mm/damon/vaddr: record appropriate folio size when the access is not found 2023-01-18 17:12:58 -08:00