Commit 5d286d5e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents ceb1adba 4fa3b1c4
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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);
}