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: Mon, 20 Sep 2010 20:50:01 +0200 Message-ID: <20100920185001.GA955@redhat.com> References: <20100917152639.0e88341a@basil.nowhere.org> <1284736618-27153-2-git-send-email-wad@chromium.org> <20100918012939.GA25046@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andi Kleen , linux-kernel@vger.kernel.org, Alexander Viro , Andrew Morton , KOSAKI Motohiro , Roland McGrath , Neil Horman , "Eric W. Biederman" , containers@lists.linux-foundation.org, Eugene Teo , Tejun Heo , Serge Hallyn , Alexey Dobriyan , linux-fsdevel@vger.kernel.org To: Will Drewry Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On 09/17, Will Drewry wrote: > > On Fri, Sep 17, 2010 at 8:29 PM, Oleg Nesterov wrote: > > > > 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. > > I wasn't sure if it was reasonable to pass the current task_struct > over, but I certainly can. Why not? current calls call_usermodehelper_exec(), it can't go away until subprocess_info->init() returns, it sleeps on wait_for_completion(). > In practice, this seems to amount to just adding a refcount to all the > namespaces and creating a new nsproxy which isn't really needed. Most > likely, doing what you've suggested above plus the copy_fs_struct and > the swap out will do the trick. I'll try it out and see. That's make > it much clearer I think. Yes, just get_nsproxy() (like fork() does) should be fine in this case. As for copying ->fs, I am not sure actually. core_pattern is global, say it is "|/coredumper". If you change ->root, then exec can fail because that binary is not visible to the coredumping process? Probably we should move core_pattern into ->pid_ns, I dunno. Oleg.