kernfs: The cgroup filesystem also benefits from SB_I_NOEXEC
[cascardo/linux.git] / fs / kernfs / mount.c
index d90d574..1443df6 100644 (file)
@@ -152,6 +152,8 @@ static int kernfs_fill_super(struct super_block *sb, unsigned long magic)
        struct dentry *root;
 
        info->sb = sb;
+       /* Userspace would break if executables appear on sysfs */
+       sb->s_iflags |= SB_I_NOEXEC;
        sb->s_blocksize = PAGE_SIZE;
        sb->s_blocksize_bits = PAGE_SHIFT;
        sb->s_magic = magic;