linux-stable/kernel/cgroup
Waiman Long 89c98802f0 cgroup/cpuset: Add cpuset_can_fork() and cpuset_cancel_fork() methods
commit eee8785379 upstream.

In the case of CLONE_INTO_CGROUP, not all cpusets are ready to accept
new tasks. It is too late to check that in cpuset_fork(). So we need
to add the cpuset_can_fork() and cpuset_cancel_fork() methods to
pre-check it before we can allow attachment to a different cpuset.

We also need to set the attach_in_progress flag to alert other code
that a new task is going to be added to the cpuset.

Fixes: ef2c41cf38 ("clone3: allow spawning processes into cgroups")
Suggested-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Waiman Long <longman@redhat.com>
Cc: stable@vger.kernel.org # v5.7+
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-20 12:36:59 +02:00
..
Makefile cgroup: Add misc cgroup controller 2021-04-04 13:34:46 -04:00
cgroup-internal.h memcg: fix possible use-after-free in memcg_write_event_control() 2022-12-09 18:41:17 -08:00
cgroup-v1.c cgroup: Use cgroup_attach_{lock,unlock}() from cgroup_attach_task_all() 2022-08-26 11:14:34 -10:00
cgroup.c Networking changes for 6.2. 2022-12-13 15:47:48 -08:00
cpuset.c cgroup/cpuset: Add cpuset_can_fork() and cpuset_cancel_fork() methods 2023-04-20 12:36:59 +02:00
debug.c kernel: cgroup: fix misuse of %x 2019-05-06 08:47:48 -07:00
freezer.c cgroup: cleanup comments 2022-03-13 19:19:27 -10:00
legacy_freezer.c cgroup,freezer: hold cpu_hotplug_lock before freezer_mutex 2023-04-20 12:36:55 +02:00
misc.c misc_cgroup: remove error log to avoid log flood 2021-09-20 07:35:38 -10:00
namespace.c memcg: enable accounting for new namesapces and struct nsproxy 2021-09-03 09:58:12 -07:00
pids.c cgroup: add pids.peak interface for pids controller 2022-09-04 09:26:51 -10:00
rdma.c cgroup: fix spelling mistakes 2021-05-24 12:45:26 -04:00
rstat.c cgroup: fix display of forceidle time at root 2023-04-20 12:36:59 +02:00