* [PATCH/cr_tests] pass a valid stack address to clone(2)
@ 2009-09-01 23:11 Nathan Lynch
[not found] ` <1251846700.23305.2.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Nathan Lynch @ 2009-09-01 23:11 UTC (permalink / raw)
To: Serge E. Hallyn; +Cc: Containers
Off-by-one error: the stack address passed to clone() must be within
the region allocated.
Signed-off-by: Nathan Lynch <ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH/cr_tests] pass a valid stack address to clone(2)
[not found] ` <1251846700.23305.2.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2009-09-02 12:53 ` Serge E. Hallyn
0 siblings, 0 replies; 2+ messages in thread
From: Serge E. Hallyn @ 2009-09-02 12:53 UTC (permalink / raw)
To: Nathan Lynch; +Cc: Containers
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 <ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
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
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-02 12:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-01 23:11 [PATCH/cr_tests] pass a valid stack address to clone(2) Nathan Lynch
[not found] ` <1251846700.23305.2.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-09-02 12:53 ` Serge E. Hallyn
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.