From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934130Ab3GWT2L (ORCPT ); Tue, 23 Jul 2013 15:28:11 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56556 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933884Ab3GWT2J (ORCPT ); Tue, 23 Jul 2013 15:28:09 -0400 Date: Tue, 23 Jul 2013 14:28:01 -0500 From: Serge Hallyn To: Tejun Heo Cc: "Eric W. Biederman" , lkml , Containers Subject: Re: [RFC PATCH 1/2] devices cgroup: allow can_attach() if ns_capable Message-ID: <20130723192801.GA9923@tp> References: <20130723181606.GA6342@sergelap> <20130723183018.GF21100@mtj.dyndns.org> <20130723183841.GA9021@tp> <20130723190426.GA9577@tp> <20130723191245.GI21100@mtj.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130723191245.GI21100@mtj.dyndns.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Tejun Heo (tj@kernel.org): > Hello, > > On Tue, Jul 23, 2013 at 02:04:26PM -0500, Serge Hallyn wrote: > > 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. > > Well, that also is the exact type of priv delegation we're moving away > from, so.... I think that's unreasonable, but I guess I'll have to go reread the old thread. > > > 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? > > If PAM is giving out perms on cgroup directory, the whole system is > prone to DoS in various ways anyway. It's already utterly broken, so If we have decent enforcement of hierarchy for devices.{allow,deny}, which we now do, then I don't see why this has to be the case. > kinda moot point. If there are people actually doing that in the > wild, we can conditionalize it on cgroup_sane_behavior(). Guess we'll stop using cgroups for now. -serge