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
This commit is contained in:
Linus Torvalds 2020-04-17 12:05:01 -07:00
commit 5d286d5ebc
1 changed files with 7 additions and 0 deletions

View File

@ -196,6 +196,13 @@ static void proc_kill_sb(struct super_block *sb)
if (ns->proc_thread_self)
dput(ns->proc_thread_self);
kill_anon_super(sb);
/* Make the pid namespace safe for the next mount of proc */
ns->proc_self = NULL;
ns->proc_thread_self = NULL;
ns->pid_gid = GLOBAL_ROOT_GID;
ns->hide_pid = 0;
put_pid_ns(ns);
}