mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-25 11:04:35 +00:00
restorer: Setup rt_sigframe to a proper address
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
345834ecee
commit
f63777d2be
2 changed files with 5 additions and 13 deletions
|
|
@ -1303,7 +1303,7 @@ static void restorer_test(pid_t pid)
|
|||
* Pass arguments and run a command.
|
||||
*/
|
||||
args = (struct restore_core_args *)(exec_start + args_offset);
|
||||
args->rt_sigframe = (void *)((long)exec_mem + RESTORER_STACK_SIZE + RESTORER_STACK_REDZONE);
|
||||
args->rt_sigframe = (void *)((long)exec_mem + RESTORER_STACK_SIZE + RESTORER_STACK_FRAME - RESTORER_STACK_REDZONE);
|
||||
args->self_entry = exec_mem;
|
||||
args->self_size = vma_len;
|
||||
|
||||
|
|
|
|||
16
restorer.c
16
restorer.c
|
|
@ -37,11 +37,6 @@
|
|||
c += 'a' - 10; \
|
||||
} while (0)
|
||||
|
||||
#define inline_memcpy(d,s,l) __builtin_memcpy(d,s,l)
|
||||
#define inline_memset(d,c,l) __builtin_memset(d,c,l)
|
||||
#define inline_memzero(d,l) __builtin_memset(d,0,l)
|
||||
#define inline_memzero_p(d) __builtin_memset(d,0,sizeof(*(d)))
|
||||
|
||||
#define sigframe_addr(p) ((long)p)
|
||||
|
||||
static void always_inline write_char(char c)
|
||||
|
|
@ -299,9 +294,7 @@ self_len_end:
|
|||
* by the kernel with stack overflow error.
|
||||
*/
|
||||
|
||||
rt_sigframe = args->rt_sigframe;
|
||||
write_hex_n((long)rt_sigframe);
|
||||
write_hex_n((long)&rt_sigframe->uc);
|
||||
rt_sigframe = args->rt_sigframe - sizeof(*rt_sigframe);
|
||||
|
||||
#define CPREG1(d) rt_sigframe->uc.uc_mcontext.d = core_entry.u.arch.gpregs.d
|
||||
#define CPREG2(d,s) rt_sigframe->uc.uc_mcontext.d = core_entry.u.arch.gpregs.s
|
||||
|
|
@ -330,10 +323,9 @@ self_len_end:
|
|||
|
||||
/* FIXME: What with cr2 and friends which are rest there? */
|
||||
|
||||
new_sp = core_entry.u.arch.gpregs.sp - 8;
|
||||
write_hex_n(new_sp);
|
||||
stack = (void *)new_sp;
|
||||
*stack = (long)rt_sigframe;
|
||||
write_hex_n(0x111);
|
||||
write_hex_n((long)rt_sigframe);
|
||||
new_sp = (long)rt_sigframe + 8;
|
||||
|
||||
/*
|
||||
* Prepare the stack and call for sigreturn,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue