From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752899AbbE0Nep (ORCPT ); Wed, 27 May 2015 09:34:45 -0400 Received: from emvm-gh1-uea09.nsa.gov ([63.239.67.10]:58842 "EHLO emvm-gh1-uea09.nsa.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752630AbbE0Nek (ORCPT ); Wed, 27 May 2015 09:34:40 -0400 X-TM-IMSS-Message-ID: <378ee8bc0006ca5d@nsa.gov> Message-ID: <5565C7A5.4060802@tycho.nsa.gov> Date: Wed, 27 May 2015 09:33:25 -0400 From: Stephen Smalley Organization: National Security Agency User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 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 , Tetsuo Handa , Zefan Li , Rafal Krypa , linux-doc@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, containers@lists.linux-foundation.org, Lukasz Pawelczyk Subject: Re: [PATCH v2 0/7] Smack namespace 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> In-Reply-To: <1432719372.1784.4.camel@samsung.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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.