Re: [PATCH] selftests: cgroup: simplify cpuset subtree permissions test
From: Tejun Heo
Date: Wed Aug 19 2026 - 16:13:38 EST
On Wed, Aug 19, 2026 at 06:31:52PM +0800, Shaojie Sun wrote:
> Simplify test_cpuset_perms_subtree by removing unnecessary chown of
> cgroup.procs files. The test verifies implicit migration triggered by
> enabling/disabling the cpuset controller via cgroup.subtree_control.
>
> Implicit migration is handled internally by the kernel through
> cgroup_update_dfl_csses() when subtree_control is modified, and does
> not require cgroup.procs write permission. Only cgroup.subtree_control
> permission is needed to trigger the controller state change.
That's true but making the migration work isn't why the chowns are there.
cd3c6f682df4 ("selftests: cgroup: Add cpuset migrations testcase") added the
test to verify that migration permissions follow delegation boundaries, with
the setup emulating a delegated subtree, and delegating a subtree includes
granting write access to the "cgroup.procs" files (see the Delegation
section of Documentation/admin-guide/cgroup-v2.rst).
With the chowns removed, the test instead asserts that write access to
"cgroup.subtree_control" alone lets an unprivileged user trigger implicit
migration of a privileged task. That matches the current behavior but isn't
a documented property, and if implicit migration ever becomes stricter about
delegation, the modified test would fail without anything regressing. I'd
rather keep the setup matching the documented delegation model.
Thanks.
--
tejun