mm/damon/lru_sort: handle ctx allocation failure
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.18.367.0.137.1In the Linux kernel, the following vulnerability has been resolved:
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.
From the CVE record · Linux
DAMON_LRU_SORT can dereference a NULL pointer if allocation of its damon_ctx object fails and the enablement path continues. The input does not specify whether an attacker can trigger this condition or whether authentication or user interaction is required.
Engineers running Linux kernels with DAMON_LRU_SORT should check their versions; affected versions are not specified.