diff options
-rw-r--r-- | fs/btrfs/super.c | 2 | ||||
-rw-r--r-- | fs/fuse/inode.c | 2 | ||||
-rw-r--r-- | fs/ocfs2/super.c | 2 | ||||
-rw-r--r-- | fs/super.c | 2 | ||||
-rw-r--r-- | include/linux/fs.h | 3 | ||||
-rw-r--r-- | mm/filemap.c | 2 |
6 files changed, 8 insertions, 5 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 9b2e7e5bc3ef..d158b672a2d2 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -819,7 +819,7 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags, | |||
819 | } else { | 819 | } else { |
820 | char b[BDEVNAME_SIZE]; | 820 | char b[BDEVNAME_SIZE]; |
821 | 821 | ||
822 | s->s_flags = flags; | 822 | s->s_flags = flags | MS_NOSEC; |
823 | strlcpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id)); | 823 | strlcpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id)); |
824 | error = btrfs_fill_super(s, fs_devices, data, | 824 | error = btrfs_fill_super(s, fs_devices, data, |
825 | flags & MS_SILENT ? 1 : 0); | 825 | flags & MS_SILENT ? 1 : 0); |
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index cc6ec4b2f0ff..38f84cd48b67 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c | |||
@@ -921,6 +921,8 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent) | |||
921 | if (sb->s_flags & MS_MANDLOCK) | 921 | if (sb->s_flags & MS_MANDLOCK) |
922 | goto err; | 922 | goto err; |
923 | 923 | ||
924 | sb->s_flags &= ~MS_NOSEC; | ||
925 | |||
924 | if (!parse_fuse_opt((char *) data, &d, is_bdev)) | 926 | if (!parse_fuse_opt((char *) data, &d, is_bdev)) |
925 | goto err; | 927 | goto err; |
926 | 928 | ||
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index cdbaf5e97308..56f61027236b 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -1072,7 +1072,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) | |||
1072 | 1072 | ||
1073 | sb->s_magic = OCFS2_SUPER_MAGIC; | 1073 | sb->s_magic = OCFS2_SUPER_MAGIC; |
1074 | 1074 | ||
1075 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | | 1075 | sb->s_flags = (sb->s_flags & ~(MS_POSIXACL | MS_NOSEC)) | |
1076 | ((osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0); | 1076 | ((osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0); |
1077 | 1077 | ||
1078 | /* Hard readonly mode only if: bdev_read_only, MS_RDONLY, | 1078 | /* Hard readonly mode only if: bdev_read_only, MS_RDONLY, |
diff --git a/fs/super.c b/fs/super.c index c75593953c52..ab3d672db0de 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -822,7 +822,7 @@ struct dentry *mount_bdev(struct file_system_type *fs_type, | |||
822 | } else { | 822 | } else { |
823 | char b[BDEVNAME_SIZE]; | 823 | char b[BDEVNAME_SIZE]; |
824 | 824 | ||
825 | s->s_flags = flags; | 825 | s->s_flags = flags | MS_NOSEC; |
826 | s->s_mode = mode; | 826 | s->s_mode = mode; |
827 | strlcpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id)); | 827 | strlcpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id)); |
828 | sb_set_blocksize(s, block_size(bdev)); | 828 | sb_set_blocksize(s, block_size(bdev)); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index c55d6b7cd5d6..646a1836152a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -208,6 +208,7 @@ struct inodes_stat_t { | |||
208 | #define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ | 208 | #define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ |
209 | #define MS_I_VERSION (1<<23) /* Update inode I_version field */ | 209 | #define MS_I_VERSION (1<<23) /* Update inode I_version field */ |
210 | #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ | 210 | #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ |
211 | #define MS_NOSEC (1<<28) | ||
211 | #define MS_BORN (1<<29) | 212 | #define MS_BORN (1<<29) |
212 | #define MS_ACTIVE (1<<30) | 213 | #define MS_ACTIVE (1<<30) |
213 | #define MS_NOUSER (1<<31) | 214 | #define MS_NOUSER (1<<31) |
@@ -2591,7 +2592,7 @@ static inline int is_sxid(mode_t mode) | |||
2591 | 2592 | ||
2592 | static inline void inode_has_no_xattr(struct inode *inode) | 2593 | static inline void inode_has_no_xattr(struct inode *inode) |
2593 | { | 2594 | { |
2594 | if (!is_sxid(inode->i_mode)) | 2595 | if (!is_sxid(inode->i_mode) && (inode->i_sb->s_flags & MS_NOSEC)) |
2595 | inode->i_flags |= S_NOSEC; | 2596 | inode->i_flags |= S_NOSEC; |
2596 | } | 2597 | } |
2597 | 2598 | ||
diff --git a/mm/filemap.c b/mm/filemap.c index d7b10578a64b..a8251a8d3457 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -2000,7 +2000,7 @@ int file_remove_suid(struct file *file) | |||
2000 | error = security_inode_killpriv(dentry); | 2000 | error = security_inode_killpriv(dentry); |
2001 | if (!error && killsuid) | 2001 | if (!error && killsuid) |
2002 | error = __remove_suid(dentry, killsuid); | 2002 | error = __remove_suid(dentry, killsuid); |
2003 | if (!error) | 2003 | if (!error && (inode->i_sb->s_flags & MS_NOSEC)) |
2004 | inode->i_flags |= S_NOSEC; | 2004 | inode->i_flags |= S_NOSEC; |
2005 | 2005 | ||
2006 | return error; | 2006 | return error; |