linux-yocto/kernel/cgroup
Chen Ridong 458854e2ed cgroup,freezer: fix incomplete freezing when attaching tasks
commit 37fb58a727 upstream.

An issue was found:

	# cd /sys/fs/cgroup/freezer/
	# mkdir test
	# echo FROZEN > test/freezer.state
	# cat test/freezer.state
	FROZEN
	# sleep 1000 &
	[1] 863
	# echo 863 > test/cgroup.procs
	# cat test/freezer.state
	FREEZING

When tasks are migrated to a frozen cgroup, the freezer fails to
immediately freeze the tasks, causing the cgroup to remain in the
"FREEZING".

The freeze_task() function is called before clearing the CGROUP_FROZEN
flag. This causes the freezing() check to incorrectly return false,
preventing __freeze_task() from being invoked for the migrated task.

To fix this issue, clear the CGROUP_FROZEN state before calling
freeze_task().

Fixes: f5d39b0208 ("freezer,sched: Rewrite core freezer logic")
Cc: stable@vger.kernel.org # v6.1+
Reported-by: Zhong Jiawei <zhongjiawei1@huawei.com>
Signed-off-by: Chen Ridong <chenridong@huawei.com>
Acked-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-06-27 11:07:28 +01:00
..
cgroup-internal.h cgroup: Make operations on the cgroup root_list RCU safe 2024-08-19 06:00:06 +02:00
cgroup-v1.c kernfs: Convert kernfs_path_from_node_locked() from strlcpy() to strscpy() 2024-08-03 08:48:54 +02:00
cgroup.c cgroup: Fix compilation issue due to cgroup_mutex not being exported 2025-06-04 14:40:01 +02:00
cpuset.c cgroup/cpuset: Prevent UAF in proc_cpuset_show() 2024-08-03 08:48:54 +02:00
debug.c
freezer.c
legacy_freezer.c cgroup,freezer: fix incomplete freezing when attaching tasks 2025-06-27 11:07:28 +01:00
Makefile
misc.c
namespace.c cgroup:namespace: Remove unused cgroup_namespaces_init() 2023-09-13 09:42:56 +02:00
pids.c cgroup: add pids.peak interface for pids controller 2022-09-04 09:26:51 -10:00
rdma.c
rstat.c cgroup: Remove steal time from usage_usec 2025-02-21 13:49:57 +01:00