summaryrefslogtreecommitdiff
path: root/drivers/clk/aspeed/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2026-05-28 17:01:02 -0700
committerAndrew Morton <akpm@linux-foundation.org>2026-06-03 16:25:50 -0700
commit7e2ed8a29427af534bf2cb9b8bc51762b8b6e654 (patch)
tree9c31c943e41e85c81a832cbb5cd07e978b1f855c /drivers/clk/aspeed/git@git.tavy.me:linux.git
parent732fd9f0b9c1cdc6dfd77162ded60df005182cc0 (diff)
mm/damon/reclaim: handle ctx allocation failure
Patch series "mm/damon/{reclaim,lru_sort}: handle ctx allocation failures". DAMON_RECLAIM and DAMON_LRU_SORT could dereference NULL pointers if their damon_ctx object allocations fail. The bugs are expected to happen infrequently because the allocations are arguably too small to fail on common setups. But theoretically they are possible and the consequences are bad. Fix those. The issues were discovered [1] by Sashiko. This patch (of 2): DAMON_RECLAIM allocates the damon_ctx object for its kdamond in its init function. damon_reclaim_enabled_store() wrongly assumes the allocation will always succeed once tried. If the damon_ctx allocation was failed, therefore, code execution reaches to damon_commit_ctx() while 'ctx' is NULL. As a result, it dereferences the NULL 'ctx' pointer. Avoid the NULL dereference by returning -ENOMEM if 'ctx' is NULL. Link: https://lore.kernel.org/20260529000104.7006-2-sj@kernel.org Link: https://lore.kernel.org/20260419014800.877-1-sj@kernel.org [1] Fixes: 3f7a914ab9a5 ("mm/damon/reclaim: use damon_initialized()") Signed-off-by: SeongJae Park <sj@kernel.org> Cc: <stable@vger.kernel.org> # 6.18.x Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers/clk/aspeed/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions