Files
erofs-linux/mm/damon
SeongJae Park ab04340b5a mm/damon/lru_sort: handle ctx allocation failure
DAMON_LRU_SORT allocates the damon_ctx object for its kdamond in its init
function.  damon_lru_sort_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/[email protected]
Fixes: c4a8e662c8 ("mm/damon/lru_sort: use damon_initialized()")
Signed-off-by: SeongJae Park <[email protected]>
Cc: <[email protected]> # 6.18.x
Signed-off-by: Andrew Morton <[email protected]>
2026-06-03 16:25:51 -07:00
..
2025-07-09 22:41:55 -07:00