cgroup/psi: Set of->priv to NULL upon file release
authorChen Ridong <chenridong@huawei.com>
Fri, 22 Aug 2025 07:07:15 +0000 (07:07 +0000)
committerTejun Heo <tj@kernel.org>
Fri, 22 Aug 2025 17:47:43 +0000 (07:47 -1000)
commit94a4acfec14615e971eb2c9e1fa6c992c85ff6c6
treec7a31980441702c92f7f02b43181a36465a02b97
parent79f919a89c9d06816dbdbbd168fa41d27411a7f9
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>
kernel/cgroup/cgroup.c