From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 8A3AB29DFB for ; Tue, 6 Aug 2013 10:11:40 -0500 (CDT) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id 6A090304064 for ; Tue, 6 Aug 2013 08:11:37 -0700 (PDT) Received: from hallynmail2 (static.92.5.9.176.clients.your-server.de [176.9.5.92]) by cuda.sgi.com with ESMTP id cn1r32x5Sucjiqzs for ; Tue, 06 Aug 2013 08:11:33 -0700 (PDT) Date: Tue, 6 Aug 2013 15:11:32 +0000 From: "Serge E. Hallyn" Subject: Re: [PATCH v7 7/7] enable building user namespace with xfs Message-ID: <20130806151132.GA21100@mail.hallyn.com> References: <20130729230709.11033b2d@oracle.com> <20130730234021.GR3111@sgi.com> <20130731002119.GR13468@dastard> <20130731132523.GS3111@sgi.com> <20130731232852.GE7118@dastard> <20130801150643.GV3111@sgi.com> <20130801121726.08dd3123@oracle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130801121726.08dd3123@oracle.com> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Dwight Engen Cc: Ben Myers , xfs@oss.sgi.com Quoting Dwight Engen (dwight.engen@oracle.com): > On Thu, 1 Aug 2013 10:06:43 -0500 > Ben Myers wrote: > > > Dave, > > > > On Thu, Aug 01, 2013 at 09:28:52AM +1000, Dave Chinner wrote: > > > On Wed, Jul 31, 2013 at 08:25:23AM -0500, Ben Myers wrote: > > > > Hey, > > > > > > > > On Wed, Jul 31, 2013 at 10:21:19AM +1000, Dave Chinner wrote: > > > > > On Tue, Jul 30, 2013 at 06:40:21PM -0500, Ben Myers wrote: > > > > > > On Mon, Jul 29, 2013 at 11:07:09PM -0400, Dwight Engen wrote: > > > > > > > >From e6a9ee0cfa0ed40484f66bc1726dc19de36038b8 Mon Sep 17 > > > > > > > >00:00:00 2001 > > > > > > > From: Dwight Engen > > > > > > > Date: Tue, 2 Jul 2013 09:52:54 -0400 > > > > > > > Subject: [PATCH 7/7] enable building user namespace with xfs > > > > > > > > > > > > > > Signed-off-by: Dwight Engen > > > > > > > > > > > > Was there a patch running around to limit bulkstat to > > > > > > init_user_ns? Any other items that needed to be addressed > > > > > > before applying this patch? > > > > > > > > > > Bulkstat has a capable(CAP_SYS_ADMIN) check and therefore can > > > > > only be executed in the init name space. Similarly, all the > > > > > open-by-handle interfaces have the same capable() checks so > > > > > they can only be executed int he init name space, too. > > > > > > > > Gah. I was under the impression that you could have a process > > > > with CAP_SYS_ADMIN in a namespace other than init_user_ns. > > > > > > Ben, until about a week and a half ago I was also working under that > > > same understanding as you. > > > > Well huh. According to Dwight you can have a process with > > CAP_SYS_ADMIN in a namespace other than init_user_ns. Kinda cool, > > IMO. > > Yeah, see commit 3486740a and cap_capable(). Took me a bit to grok > that for loop, but I think the semantics are that if you are in a non > init_user_ns, you can start from current_user_ns() looking for a cap To be precise, you're not looking for a cap in the parent ns. You're checking whether the subject is the creator of one of the object's namespace's parents. > and walk back the heirarchy (userns's can be nested) but it won't ever > check in init_user_ns, and so by definition you have no capabilities > in init_user_ns. You also have no caps in any of your parent namespaces. The loop is checking over the *object*'s parents to see if the subject owns them. I'ts not looping over the *subject*'s parents, as they do not grant any privilege. Only the subject's bottom-most credentials grant privilege. > ie. if you are in a userns, you might be nsown_capable(CAP_SYS_ADMIN) > but you cannot ever be capable(CAP_SYS_ADMIN). Thats my understanding > anyway :) Yup. -serge _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs