- fsh-ifdef-security-fields.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     fs.h: ifdef security fields

has been removed from the -mm tree.  Its filename is

     fsh-ifdef-security-fields.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: fs.h: ifdef security fields
From: Alexey Dobriyan <adobriyan@xxxxxxxxx>

[assuming BSD security levels are deleted]
The only user of i_security, f_security, s_security fields is SELinux,
however, quite a few security modules are trying to get into kernel.
So, wrap them under CONFIG_SECURITY. Adding config option for each
security field is likely an overkill.

Following Stephen Smalley's suggestion, i_security initialization is
moved to security_inode_alloc() to not clutter core code with ifdefs
and make alloc_inode() codepath tiny little bit smaller and faster.

The user of (highly greppable) struct fown_struct::security field is
still to be found. I've checked every "fown_struct" and every "f_owner"
occurence. Additionally it's removal doesn't break i386 allmodconfig
build.

struct inode, struct file, struct super_block, struct fown_struct
become smaller.

P.S. Combined with two reiserfs inode shrinking patches sent to
linux-fsdevel, I can finally suck 12 reiserfs inodes into one page.

		/proc/slabinfo

	-ext2_inode_cache	388	10
	+ext2_inode_cache	384	10
	-inode_cache		280	14
	+inode_cache		276	14
	-proc_inode_cache	296	13
	+proc_inode_cache	292	13
	-reiser_inode_cache	336	11
	+reiser_inode_cache	332	12 <=
	-shmem_inode_cache	372	10
	+shmem_inode_cache	368	10

Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
Cc: Stephen Smalley <sds@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/inode.c               |    1 -
 include/linux/fs.h       |    8 ++++++--
 include/linux/security.h |    1 +
 3 files changed, 7 insertions(+), 3 deletions(-)

diff -puN fs/inode.c~fsh-ifdef-security-fields fs/inode.c
--- a/fs/inode.c~fsh-ifdef-security-fields
+++ a/fs/inode.c
@@ -133,7 +133,6 @@ static struct inode *alloc_inode(struct 
 		inode->i_bdev = NULL;
 		inode->i_cdev = NULL;
 		inode->i_rdev = 0;
-		inode->i_security = NULL;
 		inode->dirtied_when = 0;
 		if (security_inode_alloc(inode)) {
 			if (inode->i_sb->s_op->destroy_inode)
diff -puN include/linux/fs.h~fsh-ifdef-security-fields include/linux/fs.h
--- a/include/linux/fs.h~fsh-ifdef-security-fields
+++ a/include/linux/fs.h
@@ -553,7 +553,9 @@ struct inode {
 	unsigned int		i_flags;
 
 	atomic_t		i_writecount;
+#ifdef CONFIG_SECURITY
 	void			*i_security;
+#endif
 	void			*i_private; /* fs or device private pointer */
 #ifdef __NEED_I_SIZE_ORDERED
 	seqcount_t		i_size_seqcount;
@@ -645,7 +647,6 @@ struct fown_struct {
 	rwlock_t lock;          /* protects pid, uid, euid fields */
 	int pid;		/* pid or -pgrp where SIGIO should be sent */
 	uid_t uid, euid;	/* uid/euid of process setting the owner */
-	void *security;
 	int signum;		/* posix.1b rt signal to be delivered on IO */
 };
 
@@ -688,8 +689,9 @@ struct file {
 	struct file_ra_state	f_ra;
 
 	unsigned long		f_version;
+#ifdef CONFIG_SECURITY
 	void			*f_security;
-
+#endif
 	/* needed for tty driver, and maybe others */
 	void			*private_data;
 
@@ -877,7 +879,9 @@ struct super_block {
 	int			s_syncing;
 	int			s_need_sync_fs;
 	atomic_t		s_active;
+#ifdef CONFIG_SECURITY
 	void                    *s_security;
+#endif
 	struct xattr_handler	**s_xattr;
 
 	struct list_head	s_inodes;	/* all inodes */
diff -puN include/linux/security.h~fsh-ifdef-security-fields include/linux/security.h
--- a/include/linux/security.h~fsh-ifdef-security-fields
+++ a/include/linux/security.h
@@ -1595,6 +1595,7 @@ static inline void security_sb_post_pivo
 
 static inline int security_inode_alloc (struct inode *inode)
 {
+	inode->i_security = NULL;
 	return security_ops->inode_alloc_security (inode);
 }
 
_

Patches currently in -mm which might be from adobriyan@xxxxxxxxx are

origin.patch
asus_acpi-fix-proc-files-parsing.patch
asus_acpi-dont-printk-on-writing-garbage-to-proc-files.patch
git-dvb.patch
git-ieee1394.patch
config_pm=n-slim-drivers-pcmcia.patch
i82092-wire-up-errors-from-pci_register_driver.patch
git-serial.patch
git-scsi-misc.patch
megaraid-fix-warnings-when-config_proc_fs=n.patch
kmemdup-introduce.patch
kmemdup-some-users.patch
create-fs-utimesc.patch
proper-flags-type-of-spin_lock_irqsave.patch
remove-null-check-in-register_nls.patch
make-kmem_cache_destroy-return-void-ecryptfs.patch
config_pm=n-slim-drivers-ide-pci-sc1200c.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux