linux-yocto/mm/damon
SeongJae Park c5d5b0047b mm/damon/sysfs-schemes: free old damon_sysfs_scheme_filter->memcg_path on write
commit 4f489fe6af upstream.

memcg_path_store() assigns a newly allocated memory buffer to
filter->memcg_path, without deallocating the previously allocated and
assigned memory buffer.  As a result, users can leak kernel memory by
continuously writing a data to memcg_path DAMOS sysfs file.  Fix the leak
by deallocating the previously set memory buffer.

Link: https://lkml.kernel.org/r/20250619183608.6647-2-sj@kernel.org
Fixes: 7ee161f18b ("mm/damon/sysfs-schemes: implement filter directory")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: <stable@vger.kernel.org>		[6.3.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-07-06 11:01:38 +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: fix new damon_target objects leaks on damon_commit_targets() 2025-01-09 13:33:52 +01: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 Revert "mm/damon/lru_sort: adjust local variable to dynamic allocation" 2024-09-09 16:39:00 -07:00
Makefile
modules-common.c mm/damon: update email of SeongJae 2023-12-20 14:48:13 -08:00
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 mm/damon/ops-common: atomically test and clear young on ptes and pmds 2023-06-09 16:25:55 -07:00
paddr.c mm/damon/ops: have damon_get_folio return folio even for tail pages 2025-04-20 10:15:48 +02:00
reclaim.c mm/damon/reclaim: remove unnecessary code for online tuning 2024-07-03 19:30:14 -07:00
sysfs-common.c
sysfs-common.h mm/damon/sysfs-schemes: rename *_set_{schemes,scheme_filters,quota_score,schemes}() 2024-07-03 19:30:14 -07:00
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: move kunit tests to tests/ subdirectory with _kunit suffix 2024-09-03 21:15:58 -07:00
vaddr.c mm/damon/vaddr: fix issue in damon_va_evenly_split_region() 2024-12-09 10:41:02 +01:00