From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: [PATCH 11/11][v15]: Document sys_eclone Date: Tue, 06 Jul 2010 15:23:21 -0700 Message-ID: <4C33ACD9.6060909@zytor.com> References: <1278189164-28408-1-git-send-email-sukadev@linux.vnet.ibm.com> <1278189164-28408-12-git-send-email-sukadev@linux.vnet.ibm.com> <20100704233951.GK3338@count0.beaverton.ibm.com> <4C315D2D.6000107@cs.columbia.edu> <4C3347CA.8060703@cs.columbia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4C3347CA.8060703-eQaUEPhvms7ENvBUuze7eA@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 To: Oren Laadan Cc: Randy Dunlap , Serge Hallyn , Arnd Bergmann , Albert Cahalan , Containers , Nathan Lynch , Dan Smith , Sukadev Bhattiprolu , Roland McGrath List-Id: containers.vger.kernel.org On 07/06/2010 08:12 AM, Oren Laadan wrote: >> >> The child returns from vfork, via the same return address that >> the parent will later use. (on the stack for many architectures) >> The child then calls a function which might not have the same >> stack layout as vfork, scrambling whatever may be on the stack >> that the parent will be using to return from vfork. The parent may >> then end up using a return address that has been corrupted. >> To make this work, gcc actually recognizes vfork and has >> special handling for it. > > I assumed that this is taken care of by libc rather than the > compiler, like it is done for clone(2). > No, vfork is *really* special, because the two threads share a stack. -hpa