mirror of
https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9.git
synced 2026-09-09 00:08:12 +08:00
cgroup/psi: Set of->priv to NULL upon file release
JIRA: https://redhat.atlassian.net/browse/RHEL-232556 commit 94a4acfec14615e971eb2c9e1fa6c992c85ff6c6 Author: Chen Ridong <chenridong@huawei.com> Date: Fri, 22 Aug 2025 07:07:15 +0000 cgroup/psi: Set of->priv to NULL upon file release 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> Signed-off-by: Waiman Long <longman@redhat.com>
This commit is contained in:
@@ -4197,6 +4197,7 @@ static void cgroup_file_release(struct kernfs_open_file *of)
|
||||
cft->release(of);
|
||||
put_cgroup_ns(ctx->ns);
|
||||
kfree(ctx);
|
||||
of->priv = NULL;
|
||||
}
|
||||
|
||||
static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,
|
||||
|
||||
Reference in New Issue
Block a user