[CRIU] [PATCH] parasite: stack must be initialized by highest address

Andrey Wagin avagin at gmail.com
Tue Nov 5 07:30:28 PST 2013


2013/11/5 Alexander Kartashov <alekskartashov at parallels.com>:
> On 11/05/2013 06:28 PM, Andrey Vagin wrote:
>>
>> Stack grows down on x86 and ARM
>>
>> Signed-off-by: Andrey Vagin <avagin at openvz.org>
>> ---
>>   parasite-syscall.c | 5 ++---
>>   1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/parasite-syscall.c b/parasite-syscall.c
>> index 352b7e7..133afeb 100644
>> --- a/parasite-syscall.c
>> +++ b/parasite-syscall.c
>> @@ -1178,13 +1178,12 @@ struct parasite_ctl *parasite_infect_seized(pid_t
>> pid, struct pstree_item *item,
>>         ctl->sigframe   = ctl->local_map  + p;
>>         p += RESTORE_STACK_SIGFRAME;
>> -
>> -       ctl->rstack = ctl->remote_map + p;
>>         p += PARASITE_STACK_SIZE;
>> +       ctl->rstack = ctl->remote_map + p;
>>         if (item->nr_threads > 1) {
>> -               ctl->r_thread_stack = ctl->remote_map + p;
>>                 p += PARASITE_STACK_SIZE;
>> +               ctl->r_thread_stack = ctl->remote_map + p;
>>         }
>>         if (parasite_start_daemon(ctl, item))
>
> Ack.
>
> Why haven't we noticed that until now?! :)

We allocate memory for parasite args with some reserve. In most cases
this reserve is enough for stack.

>
> --
> Sincerely yours,
> Alexander Kartashov
>
> Intern
> Core team
>
> www.parallels.com
>
> Skype: aleksandr.kartashov
> Email: alekskartashov at parallels.com
>


More information about the CRIU mailing list