]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/proc/inode.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm...
[karo-tx-linux.git] / fs / proc / inode.c
index 42305ddcbaa00124cfbdaccf6c44b6c33cf7f701..c1b72388e57115747790948a172312738997fb0a 100644 (file)
@@ -457,17 +457,30 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de)
        return inode;
 }
 
-int proc_fill_super(struct super_block *s)
+int proc_fill_super(struct super_block *s, void *data, int silent)
 {
+       struct pid_namespace *ns = get_pid_ns(s->s_fs_info);
        struct inode *root_inode;
        int ret;
 
+       if (!proc_parse_options(data, ns))
+               return -EINVAL;
+
+       /* User space would break if executables or devices appear on proc */
+       s->s_iflags |= SB_I_USERNS_VISIBLE | SB_I_NOEXEC | SB_I_NODEV;
        s->s_flags |= MS_NODIRATIME | MS_NOSUID | MS_NOEXEC;
        s->s_blocksize = 1024;
        s->s_blocksize_bits = 10;
        s->s_magic = PROC_SUPER_MAGIC;
        s->s_op = &proc_sops;
        s->s_time_gran = 1;
+
+       /*
+        * procfs isn't actually a stacking filesystem; however, there is
+        * too much magic going on inside it to permit stacking things on
+        * top of it
+        */
+       s->s_stack_depth = FILESYSTEM_MAX_STACK_DEPTH;
        
        pde_get(&proc_root);
        root_inode = proc_get_inode(s, &proc_root);