Merge branch 'work.sane_pwd' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[GitHub/MotorolaMobilityLLC/kernel-slsi.git] / kernel / pid.c
index 0291804151b587e880ed6e2072bc4217c4694db5..fd1cde1e45760df67a6cc54fa97959061660ab3f 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/syscalls.h>
 #include <linux/proc_ns.h>
 #include <linux/proc_fs.h>
+#include <linux/sched/task.h>
 
 #define pid_hashfn(nr, ns)     \
        hash_long((unsigned long)nr + (unsigned long)ns, pidhash_shift)
@@ -320,8 +321,10 @@ struct pid *alloc_pid(struct pid_namespace *ns)
        }
 
        if (unlikely(is_child_reaper(pid))) {
-               if (pid_ns_prepare_proc(ns))
+               if (pid_ns_prepare_proc(ns)) {
+                       disable_pid_allocation(ns);
                        goto out_free;
+               }
        }
 
        get_pid_ns(ns);