summaryrefslogtreecommitdiffstats
path: root/fs/proc/root.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/root.c')
-rw-r--r--fs/proc/root.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/proc/root.c b/fs/proc/root.c
index 8b145e7b9661..74c2c6ab10bd 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -157,8 +157,6 @@ static int proc_get_tree(struct fs_context *fc)
157{ 157{
158 struct proc_fs_context *ctx = fc->fs_private; 158 struct proc_fs_context *ctx = fc->fs_private;
159 159
160 put_user_ns(fc->user_ns);
161 fc->user_ns = get_user_ns(ctx->pid_ns->user_ns);
162 fc->s_fs_info = ctx->pid_ns; 160 fc->s_fs_info = ctx->pid_ns;
163 return vfs_get_super(fc, vfs_get_keyed_super, proc_fill_super); 161 return vfs_get_super(fc, vfs_get_keyed_super, proc_fill_super);
164} 162}
@@ -167,8 +165,7 @@ static void proc_fs_context_free(struct fs_context *fc)
167{ 165{
168 struct proc_fs_context *ctx = fc->fs_private; 166 struct proc_fs_context *ctx = fc->fs_private;
169 167
170 if (ctx->pid_ns) 168 put_pid_ns(ctx->pid_ns);
171 put_pid_ns(ctx->pid_ns);
172 kfree(ctx); 169 kfree(ctx);
173} 170}
174 171
@@ -188,6 +185,8 @@ static int proc_init_fs_context(struct fs_context *fc)
188 return -ENOMEM; 185 return -ENOMEM;
189 186
190 ctx->pid_ns = get_pid_ns(task_active_pid_ns(current)); 187 ctx->pid_ns = get_pid_ns(task_active_pid_ns(current));
188 put_user_ns(fc->user_ns);
189 fc->user_ns = get_user_ns(ctx->pid_ns->user_ns);
191 fc->fs_private = ctx; 190 fc->fs_private = ctx;
192 fc->ops = &proc_fs_context_ops; 191 fc->ops = &proc_fs_context_ops;
193 return 0; 192 return 0;