android_kernel_xiaomi_sm8450/mm/damon
SeongJae Park e0243d1991 UPSTREAM: mm/damon/core: initialize damon_target->list in damon_new_target()
'struct damon_target' creation function, 'damon_new_target()' is not
initializing its '->list' field, unlike other DAMON structs creator
functions such as 'damon_new_region()'.  Normal users of
'damon_new_target()' initializes the field by adding the target to DAMON
context's targets list, but some code could access the uninitialized
field.

This commit avoids the case by initializing the field in
'damon_new_target()'.

Bug: 254441685
Link: https://lkml.kernel.org/r/20221002193130.8227-1-sj@kernel.org
Fixes: f23b8eee1871 ("mm/damon/core: implement region-based sampling")
Signed-off-by: SeongJae Park <sj@kernel.org>
Reported-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit b1f44cdabad8c50cd72d6b6731e9fdf3730a8f4f)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Ie500358e0cc7d5bf82225e6e2b5229f6629736f4
2022-11-16 14:53:12 +00:00
..
core-test.h UPSTREAM: mm/damon/core-test: fix wrong expectations for 'damon_split_regions_of()' 2022-04-28 23:09:15 +08:00
core.c UPSTREAM: mm/damon/core: initialize damon_target->list in damon_new_target() 2022-11-16 14:53:12 +00:00
dbgfs-test.h UPSTREAM: mm/damon: fix a few spelling mistakes in comments and a pr_debug message 2022-04-28 23:09:16 +08:00
dbgfs.c UPSTREAM: mm/damon/dbgfs: fix memory leak when using debugfs_lookup() 2022-11-16 14:48:59 +00:00
Kconfig UPSTREAM: mm/damon: introduce DAMON-based Reclamation (DAMON_RECLAIM) 2022-04-28 23:09:16 +08:00
Makefile UPSTREAM: mm/damon: introduce DAMON-based Reclamation (DAMON_RECLAIM) 2022-04-28 23:09:16 +08:00
paddr.c UPSTREAM: mm/damon/schemes: account scheme actions that successfully applied 2022-04-28 23:09:18 +08:00
prmtv-common.c UPSTREAM: mm/damon/vaddr,paddr: support pageout prioritization 2022-04-28 23:09:16 +08:00
prmtv-common.h UPSTREAM: mm/damon: move damon_rand() definition into damon.h 2022-04-28 23:09:18 +08:00
reclaim.c FROMLIST: mm/damon/reclaim: Fix the timer always stays active 2022-04-28 23:09:18 +08:00
vaddr-test.h UPSTREAM: mm/damon/vaddr-test: remove unnecessary variables 2022-04-28 23:09:17 +08:00
vaddr.c UPSTREAM: mm/damon: validate if the pmd entry is present before accessing 2022-11-16 14:48:59 +00:00