[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250731192734.106214-1-inwardvessel@gmail.com>
Date: Thu, 31 Jul 2025 12:27:34 -0700
From: JP Kobryn <inwardvessel@...il.com>
To: tj@...nel.org,
shakeel.butt@...ux.dev,
mkoutny@...e.com,
yosryahmed@...gle.com,
hannes@...xchg.org,
akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org,
cgroups@...r.kernel.org,
kernel-team@...a.com
Subject: [PATCH cgroup/for-6.16-fixes] cgroup: avoid null de-ref in css_rstat_exit()
This function may be called asynchronously in scenarios where preceding
calls to css_rstat_init() have not completed. Return early in this case.
Signed-off-by: JP Kobryn <inwardvessel@...il.com>
Suggested-by: Michal Koutný <mkoutny@...e.com>
Fixes: 5da3bfa029d68 ("cgroup: use separate rstat trees for each subsystem")
Reported-by: syzbot+8d052e8b99e40bc625ed@...kaller.appspotmail.com
---
kernel/cgroup/rstat.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/cgroup/rstat.c b/kernel/cgroup/rstat.c
index cbeaa499a96a..408e52d5f7a4 100644
--- a/kernel/cgroup/rstat.c
+++ b/kernel/cgroup/rstat.c
@@ -488,6 +488,9 @@ void css_rstat_exit(struct cgroup_subsys_state *css)
if (!css_uses_rstat(css))
return;
+ if (!css->rstat_cpu)
+ return;
+
css_rstat_flush(css);
/* sanity check */
--
2.47.3
Powered by blists - more mailing lists