Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
torvalds committed Apr 17, 2020
2 parents ceb1adb + 4fa3b1c commit 5d286d5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fs/proc/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 5d286d5

Please sign in to comment.