From: Johannes Weiner <hannes@cmpxchg.org>
To: Tejun Heo <tj@kernel.org>
Cc: lizefan@huawei.com, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 4/4] cgroup: add delegation section to unified hierarchy documentation
Date: Thu, 18 Jun 2015 15:01:12 -0400 [thread overview]
Message-ID: <20150618190112.GA2182@cmpxchg.org> (raw)
In-Reply-To: <1434481817-32001-5-git-send-email-tj@kernel.org>
On Tue, Jun 16, 2015 at 03:10:17PM -0400, Tejun Heo wrote:
> +4-2. Common ancestor rule
> +
> +Let's say cgroups C0 and C1 have been delegated to user U0 who created
> +C00, C01 under C0 and C10 under C1 as follows.
> +
> + ~~~~~~~~~~~~~ - C0 - C00
> + ~ cgroup ~ \ C01
> + ~ hierarchy ~
> + ~~~~~~~~~~~~~ - C1 - C10
> +
> +C0 and C1 are separate entities in terms of resource distribution
> +regardless of their relative positions in the hierarchy. The
> +resources the processes under C0 are entitled to are controlled by
> +C0's ancestors and may be completely different from C1. It's clear
> +that the intention of delegating C0 to U0 is allowing U0 to organize
> +the processes under C0 and further control the distribution of C0's
> +resources.
> +
> +On traditional hierarchies, if a task has write access to "tasks" or
> +"cgroup.procs" file of a cgroup and its uid agrees with the target, it
> +can move the target to the cgroup. In the above example, U0 will not
> +only be able to move processes in each sub-hierarchy but also across
> +the two sub-hierarchies, effectively allowing it to violate the
> +organizational and resource restrictions implied by the hierarchical
> +structure above C0 and C1.
> +
> +On the unified hierarchy, to write to a "cgroup.procs" file, in
> +addition to the usual write permission to the file and uid match, the
> +writer must also have write acess to the "cgroup.procs" file of the
> +common ancestor of the source and destination cgroups. This prevents
> +delegatees from smuggling processes across disjoint sub-hierarchies.
I think this would be better as the first paragraph in 4.2, because it
nicely explains and summarizes the rule and its reasoning; then follow
up with detailed explanations and examples that corroborate the design
choice.
Otherwise, the patch looks good to me.
next prev parent reply other threads:[~2015-06-18 19:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-16 19:10 [PATCHSET cgroup/for-4.2] cgroup: require write perm on common ancestor for migration Tejun Heo
2015-06-16 19:10 ` [PATCH 1/4] kernfs: make kernfs_get_inode() public Tejun Heo
2015-06-16 20:58 ` Greg Kroah-Hartman
2015-06-16 19:10 ` [PATCH 2/4] cgroup: separate out cgroup_procs_write_permission() from __cgroup_procs_write() Tejun Heo
2015-06-16 19:10 ` [PATCH 3/4] cgroup: require write perm on common ancestor when moving processes on the default hierarchy Tejun Heo
2015-06-18 3:14 ` Zefan Li
2015-06-18 17:59 ` Tejun Heo
2015-06-18 17:59 ` [PATCH v2 " Tejun Heo
2015-06-18 19:04 ` Johannes Weiner
2015-06-16 19:10 ` [PATCH 4/4] cgroup: add delegation section to unified hierarchy documentation Tejun Heo
2015-06-18 19:01 ` Johannes Weiner [this message]
2015-06-18 20:23 ` [PATCH v2 " Tejun Heo
2015-06-18 20:46 ` Johannes Weiner
2015-06-18 20:55 ` [PATCHSET cgroup/for-4.2] cgroup: require write perm on common ancestor for migration Tejun Heo
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=20150618190112.GA2182@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=cgroups@vger.kernel.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=tj@kernel.org \
/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