Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
f63777d2
Commit
f63777d2
authored
Nov 03, 2011
by
Cyrill Gorcunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restorer: Setup rt_sigframe to a proper address
Signed-off-by:
Cyrill Gorcunov
<
gorcunov@gmail.com
>
parent
345834ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
13 deletions
+5
-13
cr-restore.c
cr-restore.c
+1
-1
restorer.c
restorer.c
+4
-12
No files found.
cr-restore.c
View file @
f63777d2
...
...
@@ -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
;
...
...
restorer.c
View file @
f63777d2
...
...
@@ -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,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment