From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mimi Zohar Subject: Re: [PATCH 02/15] security: move LSM xattrnames to xattr.h Date: Fri, 25 Jun 2010 07:15:06 -0400 Message-ID: <1277464506.3220.5.camel@localhost.localdomain> References: <1277403031-3080-1-git-send-email-zohar@linux.vnet.ibm.com> <1277403031-3080-3-git-send-email-zohar@linux.vnet.ibm.com> <4C242745.6050801@schaufler-ca.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-fsdevel@vger.kernel.org, James Morris , David Safford , Dave Hansen , Mimi Zohar To: Casey Schaufler Return-path: In-Reply-To: <4C242745.6050801@schaufler-ca.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, 2010-06-24 at 20:49 -0700, Casey Schaufler wrote: > Mimi Zohar wrote: > > Make the security extended attributes names global. > > > > Signed-off-by: Mimi Zohar > > Acked-by: Serge Hallyn > > --- > > include/linux/capability.h | 3 --- > > include/linux/xattr.h | 10 ++++++++++ > > security/selinux/hooks.c | 3 --- > > security/smack/smack.h | 2 -- > > 4 files changed, 10 insertions(+), 8 deletions(-) > > > > diff --git a/include/linux/capability.h b/include/linux/capability.h > > index 39e5ff5..90012b9 100644 > > --- a/include/linux/capability.h > > +++ b/include/linux/capability.h > > @@ -49,9 +49,6 @@ typedef struct __user_cap_data_struct { > > } __user *cap_user_data_t; > > > > > > -#define XATTR_CAPS_SUFFIX "capability" > > -#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX > > - > > #define VFS_CAP_REVISION_MASK 0xFF000000 > > #define VFS_CAP_REVISION_SHIFT 24 > > #define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK > > diff --git a/include/linux/xattr.h b/include/linux/xattr.h > > index 0cfa1e9..62ca853 100644 > > --- a/include/linux/xattr.h > > +++ b/include/linux/xattr.h > > @@ -33,6 +33,16 @@ > > #define XATTR_USER_PREFIX "user." > > #define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1) > > > > +/* Security namespace */ > > +#define XATTR_SELINUX_SUFFIX "selinux" > > +#define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX > > + > > +#define XATTR_SMACK_SUFFIX "SMACK64" > > +#define XATTR_NAME_SMACK XATTR_SECURITY_PREFIX XATTR_SMACK_SUFFIX > > + > > +#define XATTR_CAPS_SUFFIX "capability" > > +#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX > > + > > struct inode; > > struct dentry; > > > > diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c > > index 0f524b7..85338f0 100644 > > --- a/security/selinux/hooks.c > > +++ b/security/selinux/hooks.c > > @@ -87,9 +87,6 @@ > > #include "netlabel.h" > > #include "audit.h" > > > > -#define XATTR_SELINUX_SUFFIX "selinux" > > -#define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX > > - > > #define NUM_SEL_MNT_OPTS 5 > > > > extern int selinux_nlmsg_lookup(u16 sclass, u16 nlmsg_type, u32 *perm); > > diff --git a/security/smack/smack.h b/security/smack/smack.h > > index c6e9aca..9c773e3 100644 > > --- a/security/smack/smack.h > > +++ b/security/smack/smack.h > > @@ -126,10 +126,8 @@ struct smack_known { > > /* > > * xattr names > > */ > > -#define XATTR_SMACK_SUFFIX "SMACK64" > > #define XATTR_SMACK_IPIN "SMACK64IPIN" > > #define XATTR_SMACK_IPOUT "SMACK64IPOUT" > > -#define XATTR_NAME_SMACK XATTR_SECURITY_PREFIX XATTR_SMACK_SUFFIX > > #define XATTR_NAME_SMACKIPIN XATTR_SECURITY_PREFIX XATTR_SMACK_IPIN > > #define XATTR_NAME_SMACKIPOUT XATTR_SECURITY_PREFIX XATTR_SMACK_IPOUT > > > > Why just the SMACK64 attribute name, and not the others? They are > manipulated with the same interfaces (well, fsetxattr, fgetxattr) > as the SMACK64 attribute. There isn't any conceptual difference and > the rationale for moving attribute names really ought to apply to > them as well. Hi Casey, Moving the other SMACK xattrs is fine, but are they used on persistent files and need to be EVM protected? Mimi