From: Sukadev Bhattiprolu Date: Wed, 23 Sep 2009 22:57:22 +0000 (-0700) Subject: pidns: deny CLONE_PARENT|CLONE_NEWPID combination X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e5a4738699d6eca408dcb225bd350413927701e2;p=openwrt%2Fstaging%2Fblogic.git 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: Sukadev Bhattiprolu Acked-by: Roland McGrath Acked-by: Serge Hallyn Cc: Oren Laadan Cc: Oleg Nesterov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c index 821722ae58a7..86b3796b0436 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c @@ -118,7 +118,7 @@ struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *old { if (!(flags & CLONE_NEWPID)) return get_pid_ns(old_ns); - if (flags & CLONE_THREAD) + if (flags & (CLONE_THREAD|CLONE_PARENT)) return ERR_PTR(-EINVAL); return create_pid_namespace(old_ns); }