Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 2 Apr 2020 18:22:17 +0000 (11:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 2 Apr 2020 18:22:17 +0000 (11:22 -0700)
Pull exec/proc updates from Eric Biederman:
 "This contains two significant pieces of work: the work to sort out
  proc_flush_task, and the work to solve a deadlock between strace and
  exec.

  Fixing proc_flush_task so that it no longer requires a persistent
  mount makes improvements to proc possible. The removal of the
  persistent mount solves an old regression that that caused the hidepid
  mount option to only work on remount not on mount. The regression was
  found and reported by the Android folks. This further allows Alexey
  Gladkov's work making proc mount options specific to an individual
  mount of proc to move forward.

  The work on exec starts solving a long standing issue with exec that
  it takes mutexes of blocking userspace applications, which makes exec
  extremely deadlock prone. For the moment this adds a second mutex with
  a narrower scope that handles all of the easy cases. Which makes the
  tricky cases easy to spot. With a little luck the code to solve those
  deadlocks will be ready by next merge window"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (25 commits)
  signal: Extend exec_id to 64bits
  pidfd: Use new infrastructure to fix deadlocks in execve
  perf: Use new infrastructure to fix deadlocks in execve
  proc: io_accounting: Use new infrastructure to fix deadlocks in execve
  proc: Use new infrastructure to fix deadlocks in execve
  kernel/kcmp.c: Use new infrastructure to fix deadlocks in execve
  kernel: doc: remove outdated comment cred.c
  mm: docs: Fix a comment in process_vm_rw_core
  selftests/ptrace: add test cases for dead-locks
  exec: Fix a deadlock in strace
  exec: Add exec_update_mutex to replace cred_guard_mutex
  exec: Move exec_mmap right after de_thread in flush_old_exec
  exec: Move cleanup of posix timers on exec out of de_thread
  exec: Factor unshare_sighand out of de_thread and call it separately
  exec: Only compute current once in flush_old_exec
  pid: Improve the comment about waiting in zap_pid_ns_processes
  proc: Remove the now unnecessary internal mount of proc
  uml: Create a private mount of proc for mconsole
  uml: Don't consult current to find the proc_mnt in mconsole_proc
  proc: Use a list of inodes to flush from proc
  ...

1  2 
fs/exec.c
include/linux/proc_ns.h
include/linux/sched.h
kernel/events/core.c
kernel/exit.c
kernel/fork.c
kernel/pid.c
kernel/signal.c

diff --cc fs/exec.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc kernel/exit.c
Simple merge
diff --cc kernel/fork.c
Simple merge
diff --cc kernel/pid.c
@@@ -247,21 -244,6 +244,16 @@@ struct pid *alloc_pid(struct pid_namesp
                tmp = tmp->parent;
        }
  
-       if (unlikely(is_child_reaper(pid))) {
-               if (pid_ns_prepare_proc(ns))
-                       goto out_free;
-       }
 +      /*
 +       * ENOMEM is not the most obvious choice especially for the case
 +       * where the child subreaper has already exited and the pid
 +       * namespace denies the creation of any new processes. But ENOMEM
 +       * is what we have exposed to userspace for a long time and it is
 +       * documented behavior for pid namespaces. So we can't easily
 +       * change it even if there were an error code better suited.
 +       */
 +      retval = -ENOMEM;
 +
        get_pid_ns(ns);
        refcount_set(&pid->count, 1);
        for (type = 0; type < PIDTYPE_MAX; ++type)
diff --cc kernel/signal.c
Simple merge