Skip to content

Commit 5d286d5

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
Pull proc fix from Eric Biederman: "While running syzbot happened to spot one more oversight in my rework of proc_flush_task. The fields proc_self and proc_thread_self were not being reinitialized when proc was unmounted, which could cause problems if the mount of proc fails" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: proc: Handle umounts cleanly
2 parents ceb1adb + 4fa3b1c commit 5d286d5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fs/proc/root.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ static void proc_kill_sb(struct super_block *sb)
196196
if (ns->proc_thread_self)
197197
dput(ns->proc_thread_self);
198198
kill_anon_super(sb);
199+
200+
/* Make the pid namespace safe for the next mount of proc */
201+
ns->proc_self = NULL;
202+
ns->proc_thread_self = NULL;
203+
ns->pid_gid = GLOBAL_ROOT_GID;
204+
ns->hide_pid = 0;
205+
199206
put_pid_ns(ns);
200207
}
201208

0 commit comments

Comments
 (0)