linux-stable/mm/damon
SeongJae Park 5f1fc67f2c mm/damon/core: initialize damo_filter->list from damos_new_filter()
damos_new_filter() is not initializing the list field of newly allocated
filter object.  However, DAMON sysfs interface and DAMON_RECLAIM are not
initializing it after calling damos_new_filter().  As a result, accessing
uninitialized memory is possible.  Actually, adding multiple DAMOS filters
via DAMON sysfs interface caused NULL pointer dereferencing.  Initialize
the field just after the allocation from damos_new_filter().

Link: https://lkml.kernel.org/r/20230729203733.38949-2-sj@kernel.org
Fixes: 98def236f6 ("mm/damon/core: implement damos filter")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-08-04 13:03:43 -07: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: initialise context before test in damon_test_set_attrs() 2023-07-27 13:07:03 -07:00
core.c mm/damon/core: initialize damo_filter->list from damos_new_filter() 2023-08-04 13:03:43 -07: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: ptep_get() conversion 2023-06-19 16:19:25 -07: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: ptep_get() conversion 2023-06-19 16:19:25 -07: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 more kobj_type structures constant 2023-04-05 19:42:59 -07: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: ptep_get() conversion 2023-06-19 16:19:25 -07:00