]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm/damon/core: get memcg reference before access
authorShakeel Butt <shakeel.butt@linux.dev>
Thu, 25 Dec 2025 00:29:04 +0000 (16:29 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 15 Jan 2026 06:16:21 +0000 (22:16 -0800)
commita38be546269073bf8edc3c49eaf18cdfce905777
treeeafc373d4320d2cd347ff43e08ec8073cfb34c20
parent582f0f3864110e1c6e4af3af768e1c2453ba2306
mm/damon/core: get memcg reference before access

The commit b74a120bcf507 ("mm/damon/core: implement
DAMOS_QUOTA_NODE_MEMCG_USED_BP") added accesses to memcg structure without
getting reference to it.  This is unsafe.  Let's get the reference before
accessing the memcg.

Link: https://lkml.kernel.org/r/20251225002904.139543-1-shakeel.butt@linux.dev
Fixes: b74a120bcf507 ("mm/damon/core: implement DAMOS_QUOTA_NODE_MEMCG_USED_BP")
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/core.c