]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
security: pass mount flags to security_sb_kern_mount()
authorJames Morris <jmorris@namei.org>
Thu, 18 Dec 2008 23:44:42 +0000 (10:44 +1100)
committerJames Morris <jmorris@namei.org>
Fri, 19 Dec 2008 22:02:39 +0000 (09:02 +1100)
Pass mount flags to security_sb_kern_mount(), so security modules
can determine if a mount operation is being performed by the kernel.

Signed-off-by: James Morris <jmorris@namei.org>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
fs/super.c
include/linux/security.h
security/capability.c
security/security.c
security/selinux/hooks.c
security/smack/smack_lsm.c

index 400a7608f15e7ea7b84837b106db1765c3efff4c..ddba069d7a99e515f4c6bb16dd61b4b379423a9c 100644 (file)
@@ -914,7 +914,7 @@ vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void
                goto out_free_secdata;
        BUG_ON(!mnt->mnt_sb);
 
-       error = security_sb_kern_mount(mnt->mnt_sb, secdata);
+       error = security_sb_kern_mount(mnt->mnt_sb, flags, secdata);
        if (error)
                goto out_sb;
 
index 6423abf1ac0faee1385d460bcd9951b1bd85a955..3416cb85e77becc52a5c702904d4cc51bdbcdfbe 100644 (file)
@@ -1308,7 +1308,7 @@ struct security_operations {
        int (*sb_alloc_security) (struct super_block *sb);
        void (*sb_free_security) (struct super_block *sb);
        int (*sb_copy_data) (char *orig, char *copy);
-       int (*sb_kern_mount) (struct super_block *sb, void *data);
+       int (*sb_kern_mount) (struct super_block *sb, int flags, void *data);
        int (*sb_show_options) (struct seq_file *m, struct super_block *sb);
        int (*sb_statfs) (struct dentry *dentry);
        int (*sb_mount) (char *dev_name, struct path *path,
@@ -1575,7 +1575,7 @@ int security_bprm_secureexec(struct linux_binprm *bprm);
 int security_sb_alloc(struct super_block *sb);
 void security_sb_free(struct super_block *sb);
 int security_sb_copy_data(char *orig, char *copy);
-int security_sb_kern_mount(struct super_block *sb, void *data);
+int security_sb_kern_mount(struct super_block *sb, int flags, void *data);
 int security_sb_show_options(struct seq_file *m, struct super_block *sb);
 int security_sb_statfs(struct dentry *dentry);
 int security_sb_mount(char *dev_name, struct path *path,
@@ -1850,7 +1850,7 @@ static inline int security_sb_copy_data(char *orig, char *copy)
        return 0;
 }
 
-static inline int security_sb_kern_mount(struct super_block *sb, void *data)
+static inline int security_sb_kern_mount(struct super_block *sb, int flags, void *data)
 {
        return 0;
 }
index b9e391425e6fb5efb1e56fa12771af1cac876e89..2dce66fcb992a106196054847c21f93cd87c5eeb 100644 (file)
@@ -59,7 +59,7 @@ static int cap_sb_copy_data(char *orig, char *copy)
        return 0;
 }
 
-static int cap_sb_kern_mount(struct super_block *sb, void *data)
+static int cap_sb_kern_mount(struct super_block *sb, int flags, void *data)
 {
        return 0;
 }
index f0d96a6cc4e91f6083da05314c51ad94b68ba96c..d85dbb37c97261a37b96e5ddfee3e8ea1599ff3d 100644 (file)
@@ -254,9 +254,9 @@ int security_sb_copy_data(char *orig, char *copy)
 }
 EXPORT_SYMBOL(security_sb_copy_data);
 
-int security_sb_kern_mount(struct super_block *sb, void *data)
+int security_sb_kern_mount(struct super_block *sb, int flags, void *data)
 {
-       return security_ops->sb_kern_mount(sb, data);
+       return security_ops->sb_kern_mount(sb, flags, data);
 }
 
 int security_sb_show_options(struct seq_file *m, struct super_block *sb)
index 8dbc54cde59e69e40d01a4baf655ce1c10f8d3d5..7465d713b531911f0d50a3cf21e7b4f3aa7f7b74 100644 (file)
@@ -2474,7 +2474,7 @@ out:
        return rc;
 }
 
-static int selinux_sb_kern_mount(struct super_block *sb, void *data)
+static int selinux_sb_kern_mount(struct super_block *sb, int flags, void *data)
 {
        const struct cred *cred = current_cred();
        struct avc_audit_data ad;
index 8ad48161cef50405ca55c4174483df3e337e673c..1b5551dfc1f74ab2119db364ef4dab08e3bcc373 100644 (file)
@@ -250,11 +250,12 @@ static int smack_sb_copy_data(char *orig, char *smackopts)
 /**
  * smack_sb_kern_mount - Smack specific mount processing
  * @sb: the file system superblock
+ * @flags: the mount flags
  * @data: the smack mount options
  *
  * Returns 0 on success, an error code on failure
  */
-static int smack_sb_kern_mount(struct super_block *sb, void *data)
+static int smack_sb_kern_mount(struct super_block *sb, int flags, void *data)
 {
        struct dentry *root = sb->s_root;
        struct inode *inode = root->d_inode;