Skip to content

Commit ba1c4fe

Browse files
committed
cgroup/psi: Set of->priv to NULL upon file release
jira LE-4659 cve CVE-2025-39881 Rebuild_History Non-Buildable kernel-6.12.0-55.42.1.el10_0 commit-author Chen Ridong <chenridong@huawei.com> commit 94a4acf Setting of->priv to NULL when the file is released enables earlier bug detection. This allows potential bugs to manifest as NULL pointer dereferences rather than use-after-free errors[1], which are generally more difficult to diagnose. [1] https://lore.kernel.org/cgroups/38ef3ff9-b380-44f0-9315-8b3714b0948d@huaweicloud.com/T/#m8a3b3f88f0ff3da5925d342e90043394f8b2091b Signed-off-by: Chen Ridong <chenridong@huawei.com> Signed-off-by: Tejun Heo <tj@kernel.org> (cherry picked from commit 94a4acf) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent a137c3b commit ba1c4fe

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/cgroup/cgroup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4113,6 +4113,7 @@ static void cgroup_file_release(struct kernfs_open_file *of)
41134113
cft->release(of);
41144114
put_cgroup_ns(ctx->ns);
41154115
kfree(ctx);
4116+
of->priv = NULL;
41164117
}
41174118

41184119
static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,

0 commit comments

Comments
 (0)