From mboxrd@z Thu Jan 1 00:00:00 1970 From: Serge Hallyn Subject: Re: [RFC PATCH 1/2] devices cgroup: allow can_attach() if ns_capable Date: Tue, 23 Jul 2013 14:04:26 -0500 Message-ID: <20130723190426.GA9577@tp> References: <20130723181606.GA6342@sergelap> <20130723183018.GF21100@mtj.dyndns.org> <20130723183841.GA9021@tp> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Tejun Heo Cc: Containers , "Eric W. Biederman" , lkml List-Id: containers.vger.kernel.org Quoting Tejun Heo (tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org): > On Tue, Jul 23, 2013 at 2:38 PM, Serge Hallyn wrote: > > This doesn't delegate it into the container. It allows me, on the host, > > to set the cgroup for a container. > > Hmmm? I'm a bit confused. Isn't the description saying that the patch > allows pseudo-root in userns to change cgroup membership even if it > isn't actually root? If task A is uid 1000 on the host, and creates task B as uid X in a new user namespace, then task A, still being uid 1000 on the host, is privileged with respect to B and his namespace - i.e. ns_capable(B->userns, CAP_SYS_ADMIN) is true. > Besides, I find the whole check rather bogus and would actually much > prefer just nuking the check and just follow the standard permission > checks. I'd be ok with that - but there's one case I'm not sure about: If PAM sets me up with /sys/fs/cgroup/devices/serge owned by me, then if I'm thinking right, removing can_attach would mean I could move init into /sys/fs/cgroup/devices/serge... Is there something else stopping that from happening? -serge