Skip to contentSkip to conversation

remove CONFIG_XFS_SECURITY

PATCH Superseded Eric Sandeen 3 participants 8 messages Jan 7, 2008 – Apr 15, 2008 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove CONFIG_XFS_SECURITY

Is there any point to this option? Sure, it disables the ability to set security attributes at runtime, but it doesn't slim down any code.

Any reason to not remove it, and always allow security attributes to be set?

---

fs/xfs/Kconfig +0 -12
Index: linux-2.6.24-rc3/fs/xfs/Kconfig
===================================================================
@@ -35,18 +35,6 @@ config XFS_QUOTA
 	  with or without the generic quota support enabled (CONFIG_QUOTA) -
 	  they are completely independent subsystems.
 
-config XFS_SECURITY
-	bool "XFS Security Label support"
-	depends on XFS_FS
-	help
-	  Security labels support alternative access control models
-	  implemented by security modules like SELinux.  This option
-	  enables an extended attribute namespace for inode security
-	  labels in the XFS filesystem.
-
-	  If you are not using a security module that requires using
-	  extended attributes for inode security labels, say N.
-
 config XFS_POSIX_ACL
 	bool "XFS POSIX ACL support"
 	depends on XFS_FS
fs/xfs/linux-2.6/xfs_super.h +2 -7
Index: linux-2.6.24-rc3/fs/xfs/linux-2.6/xfs_super.h
===================================================================
@@ -50,13 +50,8 @@ extern void xfs_qm_exit(void);
 # define set_posix_acl_flag(sb)	do { } while (0)
 #endif
 
-#ifdef CONFIG_XFS_SECURITY
-# define XFS_SECURITY_STRING	"security attributes, "
-# define ENOSECURITY		0
-#else
-# define XFS_SECURITY_STRING
-# define ENOSECURITY		EOPNOTSUPP
-#endif
+/* Used to be "configurable" so keep it around. */
+#define XFS_SECURITY_STRING	"security attributes, "
 
 #ifdef CONFIG_XFS_RT
 # define XFS_REALTIME_STRING	"realtime, "
fs/xfs/xfs_attr.c +1 -1
Index: linux-2.6.24-rc3/fs/xfs/xfs_attr.c
===================================================================
@@ -2651,7 +2651,7 @@ attr_secure_capable(
 	bhv_vnode_t	*vp,
 	cred_t		*cred)
 {
-	return -ENOSECURITY;
+	return 0;
 }
 
 STATIC int
#1 lore raw
Quoted 6 lines · Eric Sandeen

Is there any point to this option? Sure, it disables the ability to set security attributes at runtime, but it doesn't slim down any code.

Any reason to not remove it, and always allow security attributes to be set?

I suspect the reason it is there currently is because the other
filesystems have similar option. Removing it sounds perfectly
fine to me.

#2 lore raw
In reply to Eric Sandeen
Quoted 6 lines · Eric Sandeen

Is there any point to this option? Sure, it disables the ability to set security attributes at runtime, but it doesn't slim down any code.

Any reason to not remove it, and always allow security attributes to be set?

Ack? Nak? Comments?

-Eric

Quoted 62 lines

---

Index: linux-2.6.24-rc3/fs/xfs/Kconfig
===================================================================

fs/xfs/Kconfig +0 -12
@@ -35,18 +35,6 @@ config XFS_QUOTA
 	  with or without the generic quota support enabled (CONFIG_QUOTA) -
 	  they are completely independent subsystems.
 
-config XFS_SECURITY
-	bool "XFS Security Label support"
-	depends on XFS_FS
-	help
-	  Security labels support alternative access control models
-	  implemented by security modules like SELinux.  This option
-	  enables an extended attribute namespace for inode security
-	  labels in the XFS filesystem.
-
-	  If you are not using a security module that requires using
-	  extended attributes for inode security labels, say N.
-
 config XFS_POSIX_ACL
 	bool "XFS POSIX ACL support"
 	depends on XFS_FS

Index: linux-2.6.24-rc3/fs/xfs/linux-2.6/xfs_super.h
===================================================================

fs/xfs/linux-2.6/xfs_super.h +2 -7
@@ -50,13 +50,8 @@ extern void xfs_qm_exit(void);
 # define set_posix_acl_flag(sb)	do { } while (0)
 #endif
 
-#ifdef CONFIG_XFS_SECURITY
-# define XFS_SECURITY_STRING	"security attributes, "
-# define ENOSECURITY		0
-#else
-# define XFS_SECURITY_STRING
-# define ENOSECURITY		EOPNOTSUPP
-#endif
+/* Used to be "configurable" so keep it around. */
+#define XFS_SECURITY_STRING	"security attributes, "
 
 #ifdef CONFIG_XFS_RT
 # define XFS_REALTIME_STRING	"realtime, "

Index: linux-2.6.24-rc3/fs/xfs/xfs_attr.c
===================================================================

fs/xfs/xfs_attr.c +1 -1
@@ -2651,7 +2651,7 @@ attr_secure_capable(
 	bhv_vnode_t	*vp,
 	cred_t		*cred)
 {
-	return -ENOSECURITY;
+	return 0;
 }
 
 STATIC int
#3 lore raw
Quoted 9 lines · Eric Sandeen
Quoted 5 lines · Eric Sandeen

Is there any point to this option? Sure, it disables the ability to set security attributes at runtime, but it doesn't slim down any code.

Any reason to not remove it, and always allow security attributes to be set?

Ack? Nak? Comments?

Fine by me. I'm not sure of the point either. However, don't need to modify the attr_secure_capable function, might as well delete it and
just use fs_noerr for the capable hook field.

--Tim

(BTW, will check in attr2 fixes soon - need to write a qa test ;-)

Quoted 65 lines

-Eric

Quoted 62 lines

---

Index: linux-2.6.24-rc3/fs/xfs/Kconfig
===================================================================

fs/xfs/Kconfig +0 -12
@@ -35,18 +35,6 @@ config XFS_QUOTA
 	  with or without the generic quota support enabled (CONFIG_QUOTA) -
 	  they are completely independent subsystems.
 
-config XFS_SECURITY
-	bool "XFS Security Label support"
-	depends on XFS_FS
-	help
-	  Security labels support alternative access control models
-	  implemented by security modules like SELinux.  This option
-	  enables an extended attribute namespace for inode security
-	  labels in the XFS filesystem.
-
-	  If you are not using a security module that requires using
-	  extended attributes for inode security labels, say N.
-
 config XFS_POSIX_ACL
 	bool "XFS POSIX ACL support"
 	depends on XFS_FS

Index: linux-2.6.24-rc3/fs/xfs/linux-2.6/xfs_super.h
===================================================================

fs/xfs/linux-2.6/xfs_super.h +2 -7
@@ -50,13 +50,8 @@ extern void xfs_qm_exit(void);
 # define set_posix_acl_flag(sb)	do { } while (0)
 #endif
 
-#ifdef CONFIG_XFS_SECURITY
-# define XFS_SECURITY_STRING	"security attributes, "
-# define ENOSECURITY		0
-#else
-# define XFS_SECURITY_STRING
-# define ENOSECURITY		EOPNOTSUPP
-#endif
+/* Used to be "configurable" so keep it around. */
+#define XFS_SECURITY_STRING	"security attributes, "
 
 #ifdef CONFIG_XFS_RT
 # define XFS_REALTIME_STRING	"realtime, "

Index: linux-2.6.24-rc3/fs/xfs/xfs_attr.c
===================================================================

fs/xfs/xfs_attr.c +1 -1
@@ -2651,7 +2651,7 @@ attr_secure_capable(
 	bhv_vnode_t	*vp,
 	cred_t		*cred)
 {
-	return -ENOSECURITY;
+	return 0;
 }
 
 STATIC int
#4 lore raw

PATCH v2 1/1 remove CONFIG_XFS_SECURITY

Quoted 11 lines · Timothy Shimmin
Quoted 9 lines · Eric Sandeen
Quoted 7 lines · Eric Sandeen

Is there any point to this option? Sure, it disables the ability to set security attributes at runtime, but it doesn't slim down any code.

Any reason to not remove it, and always allow security attributes to be set?

Quoted 8 lines
Quoted 3 lines

Ack? Nak? Comments?

Fine by me. I'm not sure of the point either. However, don't need to modify the attr_secure_capable function, might as well delete it and
just use fs_noerr for the capable hook field.

Oh, I see, it's normally cast... ok.

-----------------------------

There is no point to the CONFIG_XFS_SECURITY option; it disables the ability to set security attributes at runtime, but it does not actually slim down or remove any code for runtime. Just remove it and always allow security attributes to be set.

---

fs/xfs/Kconfig +0 -12
Index: linux-2.6-xfs/fs/xfs/Kconfig
===================================================================
@@ -48,18 +48,6 @@ config XFS_DMAPI
 
 	  If unsure, say N.
 
-config XFS_SECURITY
-	bool "XFS Security Label support"
-	depends on XFS_FS
-	help
-	  Security labels support alternative access control models
-	  implemented by security modules like SELinux.  This option
-	  enables an extended attribute namespace for inode security
-	  labels in the XFS filesystem.
-
-	  If you are not using a security module that requires using
-	  extended attributes for inode security labels, say N.
-
 config XFS_POSIX_ACL
 	bool "XFS POSIX ACL support"
 	depends on XFS_FS
fs/xfs/linux-2.6/xfs_super.h +1 -7
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.h
===================================================================
@@ -28,13 +28,7 @@
 # define set_posix_acl_flag(sb)	do { } while (0)
 #endif
 
-#ifdef CONFIG_XFS_SECURITY
-# define XFS_SECURITY_STRING	"security attributes, "
-# define ENOSECURITY		0
-#else
-# define XFS_SECURITY_STRING
-# define ENOSECURITY		EOPNOTSUPP
-#endif
+#define XFS_SECURITY_STRING	"security attributes, "
 
 #ifdef CONFIG_XFS_RT
 # define XFS_REALTIME_STRING	"realtime, "
fs/xfs/xfs_attr.c +1 -9
Index: linux-2.6-xfs/fs/xfs/xfs_attr.c
===================================================================
@@ -2647,14 +2647,6 @@ attr_trusted_capable(
 }
 
 STATIC int
-attr_secure_capable(
-	bhv_vnode_t	*vp,
-	cred_t		*cred)
-{
-	return -ENOSECURITY;
-}
-
-STATIC int
 attr_system_set(
 	bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
 {
@@ -2724,7 +2716,7 @@ struct attrnames attr_secure = {
 	.attr_get	= attr_generic_get,
 	.attr_set	= attr_generic_set,
 	.attr_remove	= attr_generic_remove,
-	.attr_capable	= attr_secure_capable,
+	.attr_capable	= (attrcapable_t)fs_noerr,
 };
 
 struct attrnames attr_user = {
#5 lore raw
Quoted 1 line

+#define XFS_SECURITY_STRING "security attributes, "

This one should just be killed completely, as it's not an optional feature anymore.

#6 lore raw
Quoted 5 lines · Christoph Hellwig
Quoted 1 line

+#define XFS_SECURITY_STRING "security attributes, "

This one should just be killed completely, as it's not an optional feature anymore.

My only concern is that if people are used to seeing it, they'll assume that somehow xfs now doesn't support it now, or was built without it, or ...

*shrug*

-Eric

#7 lore raw
Quoted 6 lines · Eric Sandeen
Quoted 4 lines · Christoph Hellwig
Quoted 1 line

+#define XFS_SECURITY_STRING "security attributes, "

This one should just be killed completely, as it's not an optional feature anymore.

Quoted 6 lines

My only concern is that if people are used to seeing it, they'll assume that somehow xfs now doesn't support it now, or was built without it, or ...

*shrug*

-Eric

Yeah, I kind of see your point there.
I think I'd prefer to keep it too.

--Tim