Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5a47386 authored by Sukadev Bhattiprolu's avatar Sukadev Bhattiprolu Committed by Linus Torvalds
Browse files

pidns: deny CLONE_PARENT|CLONE_NEWPID combination



CLONE_PARENT was used to implement an older threading model.  For
consistency with the CLONE_THREAD check in copy_pid_ns(), disable
CLONE_PARENT with CLONE_NEWPID, at least until the required semantics of
pid namespaces are clear.

Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@us.ibm.com>
Acked-by: default avatarRoland McGrath <roland@redhat.com>
Acked-by: default avatarSerge Hallyn <serue@us.ibm.com>
Cc: Oren Laadan <orenl@cs.columbia.edu>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 123be07b
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -118,7 +118,7 @@ struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *old
{
{
	if (!(flags & CLONE_NEWPID))
	if (!(flags & CLONE_NEWPID))
		return get_pid_ns(old_ns);
		return get_pid_ns(old_ns);
	if (flags & CLONE_THREAD)
	if (flags & (CLONE_THREAD|CLONE_PARENT))
		return ERR_PTR(-EINVAL);
		return ERR_PTR(-EINVAL);
	return create_pid_namespace(old_ns);
	return create_pid_namespace(old_ns);
}
}