Linux cgroups development
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Shaojie Sun <sunshaojie@kylinos.cn>
Cc: Waiman Long <longman@redhat.com>,
	Ridong Chen <ridong.chen@linux.dev>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Koutny <mkoutny@suse.com>, Shuah Khan <shuah@kernel.org>,
	cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests: cgroup: simplify cpuset subtree permissions test
Date: Wed, 19 Aug 2026 10:10:54 -1000	[thread overview]
Message-ID: <36946be63a1b4593d18887b4aec61be8@kernel.org> (raw)
In-Reply-To: <20260819103152.767771-1-sunshaojie@kylinos.cn>

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

      parent reply	other threads:[~2026-08-19 20:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-19 10:31 [PATCH] selftests: cgroup: simplify cpuset subtree permissions test Shaojie Sun
2026-08-19 14:34 ` Waiman Long
2026-08-19 20:10 ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36946be63a1b4593d18887b4aec61be8@kernel.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mkoutny@suse.com \
    --cc=ridong.chen@linux.dev \
    --cc=shuah@kernel.org \
    --cc=sunshaojie@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox