From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Serge E. Hallyn" Subject: Re: [PATCH/cr_tests] pass a valid stack address to clone(2) Date: Wed, 2 Sep 2009 07:53:24 -0500 Message-ID: <20090902125324.GA11628@us.ibm.com> References: <1251846700.23305.2.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1251846700.23305.2.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@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: Nathan Lynch Cc: Containers List-Id: containers.vger.kernel.org Quoting Nathan Lynch (ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org): > Off-by-one error: the stack address passed to clone() must be within > the region allocated. > > Signed-off-by: Nathan Lynch Applied, thanks. > --- > ns_exec.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/ns_exec.c b/ns_exec.c > index 09574e2..1f61771 100644 > --- a/ns_exec.c > +++ b/ns_exec.c > @@ -272,7 +272,7 @@ int main(int argc, char *argv[]) > perror("malloc"); > return -1; > } > - childstack = stack + stacksize; > + childstack = stack + stacksize - 1; > > printf("about to clone with %lx\n", flags); > flags |= SIGCHLD; > -- > 1.6.0.6 > >