summaryrefslogtreecommitdiff
path: root/kernel/pid.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2020-03-27 22:36:17 +0100
committerLinus Walleij <linus.walleij@linaro.org>2020-03-27 22:36:17 +0100
commit06dd3f31cb70035cbd3f507c11fd50e3089aeb81 (patch)
tree98065919df104fba32191f2464f4193a998cd6a1 /kernel/pid.c
parent82f04bfe2aff428b063eefd234679b2d693228ed (diff)
parent16fbf79b0f83bc752cee8589279f1ebfe57b3b6e (diff)
Merge tag 'v5.6-rc7' into devel
Linux 5.6-rc7
Diffstat (limited to 'kernel/pid.c')
-rw-r--r--kernel/pid.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/pid.c b/kernel/pid.c
index 0f4ecb57214c..647b4bb457b5 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -247,6 +247,16 @@ struct pid *alloc_pid(struct pid_namespace *ns, pid_t *set_tid,
tmp = tmp->parent;
}
+ /*
+ * 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;
+
if (unlikely(is_child_reaper(pid))) {
if (pid_ns_prepare_proc(ns))
goto out_free;