[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6e975d80-4077-fb8b-ec84-708e37c8e149@suse.de>
Date: Thu, 21 Jul 2016 08:58:32 +1000
From: Aleksa Sarai <asarai@...e.de>
To: Tejun Heo <tj@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Li Zefan <lizefan@...wei.com>,
Johannes Weiner <hannes@...xchg.org>,
"Serge E. Hallyn" <serge.hallyn@...ntu.com>,
Aditya Kali <adityakali@...gle.com>,
Chris Wilson <chris@...is-wilson.co.uk>,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org,
Christian Brauner <cbrauner@...e.de>, dev@...ncontainers.org,
James Bottomley <James.Bottomley@...senpartnership.com>
Subject: Re: [PATCH v1 3/3] cgroup: relax common ancestor restriction for
direct descendants
>> If we're moving from a parent to a direct descendant, the only end
>> result (on cgroupv2 hierarchies) is that the process experiences more
>> restrictive resource limits. Thus, there's no reason to restrict
>> processes from moving to direct descendants based on whether or not they
>> have cgroup.procs write access to their current cgroup.
>>
>> This is important for unprivileged subtree management, as it allows
>> unprivileged processes to move to their newly create subtrees.
>
> I don't think we can do this as this allows a sub-cgroup to steal an
> ancestor's process whether the ancestor likes it or not. A process
> being put in a context where it's more restricted without whatever is
> managing that part of cgroup hierarchy is not ok, at all. Please also
> note that nobody expects its processes to be stolen underneath it.
> This would be a management nightmare.
I'm not sure what you mean by "steal". The user doing the migration owns
the process, so I would argue that they aren't "stealing" anything.
While a higher level process might not know where precisely in the
hierarchy the process is, they'll know it that it must be a sub-cgroup
of the one they were put in (meaning the parent can still impose
restrictions without any issue).
If you want, we can make it so that an unprivileged user migrating
processes to a child cgroup only works if you're in the same cgroup
namespace (and have CAP_SYS_ADMIN in the pinned user namespace, etc).
The current setup would obviously still work, but you'd add a permission
for users that just want to be able to limit their own processes. IIRC
we need to update cgroup_procs_write_permission() anyway. By having the
cgroup namespace requirement, you'd definitely have to "own" the process
in every sense of the word I can imagine.
--
Aleksa Sarai
Software Engineer (Containers)
SUSE Linux GmbH
https://www.cyphar.com/
Powered by blists - more mailing lists