Initialize procfs as a pseudo filesystem instead of raising SB_I_NOEXEC and SB_I_NODEV by hand. This adds SB_I_PSEUDO. Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Reviewed-by: Alexander Mikhalitsyn Signed-off-by: Christian Brauner (Amutable) --- fs/proc/root.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/proc/root.c b/fs/proc/root.c index 7fbbe92bf73a7..ca0e75081934f 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -265,8 +266,6 @@ static int proc_fill_super(struct super_block *s, struct fs_context *fc) if (ret) return ret; - /* User space would break if executables or devices appear on proc */ - s->s_iflags |= SB_I_NOEXEC | SB_I_NODEV; s->s_flags |= SB_NODIRATIME | SB_NOSUID | SB_NOEXEC; s->s_blocksize = 1024; s->s_blocksize_bits = 10; @@ -350,6 +349,7 @@ static int proc_init_fs_context(struct fs_context *fc) put_user_ns(fc->user_ns); fc->user_ns = get_user_ns(ctx->pid_ns->user_ns); fc->fs_private = ctx; + fc_init_pseudo(fc); fc->ops = &proc_fs_context_ops; return 0; } -- 2.53.0