linux/mm/damon
SeongJae Park fafe953de2 mm/damon/tests/core-kunit: handle memory failure from damon_test_target()
damon_test_target() is assuming all dynamic memory allocation in it will
succeed.  Those are indeed likely in the real use cases since those
allocations are too small to fail, but theoretically those could fail.  In
the case, inappropriate memory access can happen.  Fix it by appropriately
cleanup pre-allocated memory and skip the execution of the remaining tests
in the failure cases.

Link: https://lkml.kernel.org/r/20251101182021.74868-4-sj@kernel.org
Fixes: 17ccae8bb5 ("mm/damon: add kunit tests")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: <stable@vger.kernel.org>	[5.15+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-11-16 17:28:30 -08:00
..
tests mm/damon/tests/core-kunit: handle memory failure from damon_test_target() 2025-11-16 17:28:30 -08:00
core.c mm/damon/core: add damon_target->obsolete for pin-point removal 2025-11-16 17:28:23 -08:00
Kconfig mm/damon/Kconfig: make DAMON_STAT_ENABLED_DEFAULT depend on DAMON_STAT 2025-09-13 16:55:07 -07:00
lru_sort.c mm/damon: add a min_sz_region parameter to damon_set_region_biggest_system_ram_default() 2025-11-16 17:28:09 -08:00
Makefile mm/damon: introduce DAMON_STAT module 2025-07-09 22:41:55 -07: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: always call rmap_walk() on locked folios 2025-11-16 17:28:00 -08:00
ops-common.h mm/damon/paddr: move filters existence check function to ops-common 2025-09-13 16:54:47 -07:00
paddr.c mm/damon/paddr: support addr_unit for DAMOS_STAT 2025-09-13 16:55:23 -07:00
reclaim.c mm/damon/reclaim: use min_sz_region for core address alignment when setting regions 2025-11-16 17:28:10 -08:00
stat.c mm/damon: add a min_sz_region parameter to damon_set_region_biggest_system_ram_default() 2025-11-16 17:28:09 -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: remove misleading todo comment in nid_show() 2025-11-16 17:28:14 -08:00
sysfs.c mm/damon/sysfs: implement obsolete_target file 2025-11-16 17:28:23 -08:00
vaddr.c mm/damon/vaddr: do not repeat pte_offset_map_lock() until success 2025-10-07 14:01:12 -07:00