Commit f964951a authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

restorer: Fix bug in address computation of thread args area

It's wrong to treat restore_thread_exec_start as arguments
area (I managed to overlook this problem in commit
01484182) it's rather
a function start address.

The thread arguments area allocated dynamically after the
restorer blob itself.

We didn't hit any problems earlier simply because there
were a few bytes owerwritten in function prologue.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
CC: Andrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent e857977b
......@@ -1601,10 +1601,10 @@ static int sigreturn_restore(pid_t pid, struct list_head *tgt_vmas, int nr_vmas)
restore_thread_exec_start = restore_code_start + restorer_blob_offset__restore_thread;
restore_task_exec_start = restore_code_start + restorer_blob_offset__restore_task;
task_args = restore_code_start + restore_code_len;
thread_args = restore_thread_exec_start;
thread_args = (void *)((long)task_args + sizeof(*task_args));
memzero_p(task_args);
memzero_p(thread_args);
memzero(thread_args, sizeof(*thread_args) * me->nr_threads);
/*
* Code at a new place.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment