mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-28 20:42:49 +00:00
restore: Call for sigreturn
Prepare the stack value and do a syscall. Still it fails because of stack corruption I think and due to lack of setup of several important values on thread-info area. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
a50600c7f4
commit
5b6748b4c9
1 changed files with 16 additions and 4 deletions
20
restorer.c
20
restorer.c
|
|
@ -301,8 +301,6 @@ self_len_end:
|
|||
|
||||
sys_close(fd_core);
|
||||
|
||||
goto core_restore_end;
|
||||
|
||||
/*
|
||||
* We need to prepare a valid sigframe here, so
|
||||
* after sigreturn the kernel will pick up the
|
||||
|
|
@ -355,8 +353,22 @@ self_len_end:
|
|||
|
||||
/* FIXME: What with cr2 and friends which are rest there? */
|
||||
|
||||
/* Finally call for sigreturn */
|
||||
sys_rt_sigreturn();
|
||||
write_hex_n(__LINE__);
|
||||
|
||||
/*
|
||||
* Prepare the stack and call for sigreturn,
|
||||
* pure assembly since we don't need any additional
|
||||
* code insns from gcc.
|
||||
*/
|
||||
asm volatile(
|
||||
"movq %0, %%rax \t\n"
|
||||
"movq %%rax, %%rsp \t\n"
|
||||
"movl $"__stringify(__NR_rt_sigreturn)", %%eax \t\n"
|
||||
"syscall \t\n"
|
||||
:
|
||||
: "r"((long)rt_sigframe + sizeof(*rt_sigframe))
|
||||
: "rax","rsp","memory");
|
||||
|
||||
|
||||
core_restore_end:
|
||||
write_hex_n(sys_getpid());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue