From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Smalley Subject: Re: [PATCH v2 0/7] Smack namespace Date: Wed, 27 May 2015 09:33:25 -0400 Message-ID: <5565C7A5.4060802@tycho.nsa.gov> References: <1432209222-8479-1-git-send-email-l.pawelczyk@samsung.com> <1432557162-19123-1-git-send-email-l.pawelczyk@samsung.com> <556484BD.2060004@tycho.nsa.gov> <1432719372.1784.4.camel@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1432719372.1784.4.camel@samsung.com> Sender: linux-doc-owner@vger.kernel.org To: Lukasz Pawelczyk Cc: "David S. Miller" , "Eric W. Biederman" , "Kirill A. Shutemov" , "Serge E. Hallyn" , Al Viro , Alexey Dobriyan , Andrew Morton , Andy Lutomirski , Casey Schaufler , David Howells , Fabian Frederick , Greg KH , James Morris , Jeff Layton , Jingoo Han , Joe Perches , John Johansen , Jonathan Corbet , Kees Cook , Mauro Carvalho Chehab , Miklos Szeredi , Oleg Nesterov , Paul Moore List-Id: linux-api@vger.kernel.org On 05/27/2015 05:36 AM, Lukasz Pawelczyk wrote: > On wto, 2015-05-26 at 10:35 -0400, Stephen Smalley wrote: >> On 05/25/2015 08:32 AM, Lukasz Pawelczyk wrote: >>> --- Usage --- >>> >>> Smack namespace is written using LSM hooks inside user namespace. That >>> means it's connected to it. >>> >>> To create a new Smack namespace you need to unshare() user namespace >>> as usual. If that is all you do though, than there is no difference to >>> what is now. To activate the Smack namespace you need to fill the >>> labels' map. It is in a file /proc/$PID/smack_map. >> >> This should be /proc/$PID/attr/label_map or similar, modeled after the >> existing /proc/$PID/attr/current and similar nodes. Then it isn't >> module-specific and can be reused for other modules. > > To make this generic I'll have to introduce new LSH hooks to handle this > file (much like /proc/$PID/attr/current). > I take this is what you had in mind. We don't have separate hooks for the /proc/self/attr/{current,exec,fscreate,keycreate,socketcreate,prev} nodes. Just one hook that passes the attribute name, and then the security hook implementation can distinguish on that.