linux-yocto/mm/damon
SeongJae Park 490a43d07f 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:00:11 +02:00
..
core-test.h mm/damon/core-test: add a unit test for __damos_filter_out() 2023-08-21 13:37:35 -07:00
core.c mm/damon/core: copy nr_accesses when splitting region 2024-11-22 15:38:37 +01:00
dbgfs-test.h
dbgfs.c mm/damon/core: implement scheme-specific apply interval 2024-11-22 15:38:35 +01:00
Kconfig
lru_sort.c mm/damon/core: implement scheme-specific apply interval 2024-11-22 15:38:35 +01:00
Makefile
modules-common.c
modules-common.h
ops-common.c mm/damon/ops-common: avoid divide-by-zero during region hotness calculation 2023-11-28 17:19:58 +00:00
ops-common.h
paddr.c
reclaim.c mm/damon/core: implement scheme-specific apply interval 2024-11-22 15:38:35 +01:00
sysfs-common.c
sysfs-common.h mm/damon/sysfs: implement a command for updating only schemes tried total bytes 2023-08-21 13:37:34 -07:00
sysfs-schemes.c mm/damon/sysfs-schemes: free old damon_sysfs_scheme_filter->memcg_path on write 2025-07-06 11:00:11 +02:00
sysfs.c mm/damon/sysfs: eliminate potential uninitialized variable warning 2023-12-13 18:45:11 +01:00
vaddr-test.h mm/damon/vaddr: fix issue in damon_va_evenly_split_region() 2024-12-14 20:00:21 +01:00
vaddr.c mm/damon/vaddr: fix issue in damon_va_evenly_split_region() 2024-12-14 20:00:21 +01:00