linux-next: manual merge of the userns tree with the pidfd-fixes tree

From: Stephen Rothwell
Date: Tue Mar 10 2020 - 00:47:14 EST


Hi all,

Today's linux-next merge of the userns tree got a conflict in:

kernel/pid.c

between commits:

b26ebfe12f34 ("pid: Fix error return value in some cases")
8deb24dcb89c ("pid: make ENOMEM return value more obvious")

from the pidfd-fixes tree and commit:

69879c01a0c3 ("proc: Remove the now unnecessary internal mount of proc")

from the userns tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

--
Cheers,
Stephen Rothwell

diff --cc kernel/pid.c
index be43122eb876,60820e72634c..000000000000
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@@ -247,21 -244,6 +244,16 @@@ struct pid *alloc_pid(struct pid_namesp
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;
- }
-
get_pid_ns(ns);
refcount_set(&pid->count, 1);
for (type = 0; type < PIDTYPE_MAX; ++type)

Attachment: pgpKFlxFVtwqd.pgp
Description: OpenPGP digital signature