aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/inode.c1
-rw-r--r--include/linux/fs.h8
-rw-r--r--include/linux/security.h1
3 files changed, 7 insertions, 3 deletions
diff --git a/fs/inode.c b/fs/inode.c
index f5c04dd9ae8a..abf77471e6c4 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -133,7 +133,6 @@ static struct inode *alloc_inode(struct super_block *sb)
133 inode->i_bdev = NULL; 133 inode->i_bdev = NULL;
134 inode->i_cdev = NULL; 134 inode->i_cdev = NULL;
135 inode->i_rdev = 0; 135 inode->i_rdev = 0;
136 inode->i_security = NULL;
137 inode->dirtied_when = 0; 136 inode->dirtied_when = 0;
138 if (security_inode_alloc(inode)) { 137 if (security_inode_alloc(inode)) {
139 if (inode->i_sb->s_op->destroy_inode) 138 if (inode->i_sb->s_op->destroy_inode)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 4caec6cebc42..6eafbe309483 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -553,7 +553,9 @@ struct inode {
553 unsigned int i_flags; 553 unsigned int i_flags;
554 554
555 atomic_t i_writecount; 555 atomic_t i_writecount;
556#ifdef CONFIG_SECURITY
556 void *i_security; 557 void *i_security;
558#endif
557 void *i_private; /* fs or device private pointer */ 559 void *i_private; /* fs or device private pointer */
558#ifdef __NEED_I_SIZE_ORDERED 560#ifdef __NEED_I_SIZE_ORDERED
559 seqcount_t i_size_seqcount; 561 seqcount_t i_size_seqcount;
@@ -645,7 +647,6 @@ struct fown_struct {
645 rwlock_t lock; /* protects pid, uid, euid fields */ 647 rwlock_t lock; /* protects pid, uid, euid fields */
646 int pid; /* pid or -pgrp where SIGIO should be sent */ 648 int pid; /* pid or -pgrp where SIGIO should be sent */
647 uid_t uid, euid; /* uid/euid of process setting the owner */ 649 uid_t uid, euid; /* uid/euid of process setting the owner */
648 void *security;
649 int signum; /* posix.1b rt signal to be delivered on IO */ 650 int signum; /* posix.1b rt signal to be delivered on IO */
650}; 651};
651 652
@@ -688,8 +689,9 @@ struct file {
688 struct file_ra_state f_ra; 689 struct file_ra_state f_ra;
689 690
690 unsigned long f_version; 691 unsigned long f_version;
692#ifdef CONFIG_SECURITY
691 void *f_security; 693 void *f_security;
692 694#endif
693 /* needed for tty driver, and maybe others */ 695 /* needed for tty driver, and maybe others */
694 void *private_data; 696 void *private_data;
695 697
@@ -877,7 +879,9 @@ struct super_block {
877 int s_syncing; 879 int s_syncing;
878 int s_need_sync_fs; 880 int s_need_sync_fs;
879 atomic_t s_active; 881 atomic_t s_active;
882#ifdef CONFIG_SECURITY
880 void *s_security; 883 void *s_security;
884#endif
881 struct xattr_handler **s_xattr; 885 struct xattr_handler **s_xattr;
882 886
883 struct list_head s_inodes; /* all inodes */ 887 struct list_head s_inodes; /* all inodes */
diff --git a/include/linux/security.h b/include/linux/security.h
index 9f56fb8a4a6c..9b5fea81f55e 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1595,6 +1595,7 @@ static inline void security_sb_post_pivotroot (struct nameidata *old_nd,
1595 1595
1596static inline int security_inode_alloc (struct inode *inode) 1596static inline int security_inode_alloc (struct inode *inode)
1597{ 1597{
1598 inode->i_security = NULL;
1598 return security_ops->inode_alloc_security (inode); 1599 return security_ops->inode_alloc_security (inode);
1599} 1600}
1600 1601