From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Nesterov Subject: Re: [PATCH 2/2] exec: move core_pattern pipe helper into the crashing namespace Date: Sat, 18 Sep 2010 03:29:39 +0200 Message-ID: <20100918012939.GA25046@redhat.com> References: <20100917152639.0e88341a@basil.nowhere.org> <1284736618-27153-2-git-send-email-wad@chromium.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Neil Horman , containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Eugene Teo , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Andi Kleen , Alexander Viro , KOSAKI Motohiro , Tejun Heo , Serge Hallyn , Andrew Morton , Alexey Dobriyan , Roland McGrath , "Eric W. Biederman" To: Will Drewry Return-path: Content-Disposition: inline In-Reply-To: <1284736618-27153-2-git-send-email-wad-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org On 09/17, Will Drewry wrote: > > Instead, this change implements the more complex option two. It > migrates the ____call_usermodehelper() thread into the same namespaces > as the dumping process. It does not assign a pid in that namespace so > the collector will appear to be pid 0. Hmm... You mean, it won't visible in that namespace? Afacis, it should have the correct pid in the init ns, no? I am a bit worried task_active_pid_ns() != nsproxy->pid_ns, but perhaps this is OK... Say, sys_getpid() returns 0, strange. > + /* Run the core_collector in the crashing namespaces */ > + if (copy_namespaces_unattached(0, current, > + &pipe_params.nsproxy, &pipe_params.fs)) { > + printk(KERN_WARNING "%s failed to copy namespaces\n", > + __func__); > + argv_free(helper_argv); > + goto fail_dropcount; > + } This looks overcomplicated to me, or I missed something. I do not understand why should we do this beforehand, and why we need copy_namespaces_unattached(). Can't you just pass current to umh_pipe_setup() (or another helper) as the argument? Then this helper can copy ->fs and ->nsproxy itself. In fact, I do not understand why create_new_namespaces() is used. It is called with flags == 0 anyway, can't we just do ns = coredumping_task->nsproxy; get_nsproxy(ns); switch_task_namespaces(current, ns); ? Oleg.