2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/mm/damon
Honggyu Kim bd225b9591 mm/damon: fix divide by zero in damon_get_intervals_score()
The current implementation allows having zero size regions with no special
reasons, but damon_get_intervals_score() gets crashed by divide by zero
when the region size is zero.

  [   29.403950] Oops: divide error: 0000 [#1] SMP NOPTI

This patch fixes the bug, but does not disallow zero size regions to keep
the backward compatibility since disallowing zero size regions might be a
breaking change for some users.

In addition, the same crash can happen when intervals_goal.access_bp is
zero so this should be fixed in stable trees as well.

Link: https://lkml.kernel.org/r/20250702000205.1921-5-honggyu.kim@sk.com
Fixes: f04b0fedbe ("mm/damon/core: implement intervals auto-tuning")
Signed-off-by: Honggyu Kim <honggyu.kim@sk.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-07-09 21:07:55 -07:00
..
tests mm/damon/tests/core-kunit: add a test for damos_set_filters_default_reject() 2025-05-22 14:55:38 -07:00
core.c mm/damon: fix divide by zero in damon_get_intervals_score() 2025-07-09 21:07:55 -07:00
Kconfig Revert "mm/damon/Kconfig: enable CONFIG_DAMON by default" 2025-06-10 10:22:15 -07:00
lru_sort.c Revert "mm/damon/lru_sort: adjust local variable to dynamic allocation" 2024-09-09 16:39:00 -07:00
Makefile mm/damon: remove DAMON debugfs interface 2025-01-25 20:22:29 -08:00
modules-common.c mm/damon: s/primitives/code/ on comments 2025-06-05 21:55:41 -07:00
modules-common.h mm/damon: s/primitives/code/ on comments 2025-06-05 21:55:41 -07:00
ops-common.c mm/damon: s/primitives/code/ on comments 2025-06-05 21:55:41 -07:00
ops-common.h mm/damon: s/primitives/code/ on comments 2025-06-05 21:55:41 -07:00
paddr.c mm/damon: s/primitives/code/ on comments 2025-06-05 21:55:41 -07:00
reclaim.c mm/damon: add 'allow' argument to damos_new_filter() 2025-01-25 20:22:32 -08:00
sysfs-common.c mm/damon: s/primitives/code/ on comments 2025-06-05 21:55:41 -07:00
sysfs-common.h mm/damon: s/primitives/code/ on comments 2025-06-05 21:55:41 -07:00
sysfs-schemes.c mm/damon/sysfs-schemes: free old damon_sysfs_scheme_filter->memcg_path on write 2025-06-25 15:55:03 -07:00
sysfs.c mm/damon/sysfs: remove damon_sysfs_cmd_request and its readers 2025-03-17 22:06:55 -07:00
vaddr.c mm/damon: s/primitives/code/ on comments 2025-06-05 21:55:41 -07:00