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
f1708959
Commit
f1708959
authored
Oct 03, 2011
by
Cyrill Gorcunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dump: Allow parasite-dumper to write pages with non-privileged process
Signed-off-by:
Cyrill Gorcunov
<
gorcunov@gmail.com
>
parent
8bbed969
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
crtools.h
include/crtools.h
+2
-1
parasite-syscall.c
parasite-syscall.c
+4
-1
No files found.
include/crtools.h
View file @
f1708959
...
...
@@ -15,7 +15,8 @@ int cr_restore_tasks(pid_t pid, bool leader_only, int leave_stopped);
int
cr_show
(
unsigned
long
pid
,
bool
leader_only
);
int
convert_to_elf
(
char
*
elf_path
,
int
fd_core
);
#define CR_FD_PERM 0600
#define CR_FD_PERM (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH)
#define CR_FD_PERM_DUMP (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
enum
{
CR_FD_FDINFO
,
...
...
parasite-syscall.c
View file @
f1708959
...
...
@@ -242,6 +242,8 @@ int parasite_dump_pages_seized(struct parasite_ctl *ctl, struct list_head *vma_a
goto
err
;
}
jerr
(
fchmod
(
cr_fdset
->
desc
[
fd_type
].
fd
,
CR_FD_PERM_DUMP
),
err
);
jerr
(
ptrace
(
PTRACE_GETREGS
,
ctl
->
pid
,
NULL
,
&
regs_orig
),
err
);
parasite_arg
.
command
=
PARASITE_CMD_DUMPPAGES
;
...
...
@@ -251,7 +253,7 @@ int parasite_dump_pages_seized(struct parasite_ctl *ctl, struct list_head *vma_a
strncpy
(
parasite_dumppages
.
open_path
,
cr_fdset
->
desc
[
fd_type
].
name
,
sizeof
(
parasite_dumppages
.
open_path
));
parasite_dumppages
.
open_flags
=
O_WRONLY
;
parasite_dumppages
.
open_mode
=
CR_FD_PERM
;
parasite_dumppages
.
open_mode
=
CR_FD_PERM
_DUMP
;
parasite_dumppages
.
fd
=
-
1UL
;
/*
...
...
@@ -384,6 +386,7 @@ err_restore:
if
(
ptrace
(
PTRACE_SETREGS
,
(
long
)
ctl
->
pid
,
NULL
,
&
regs_orig
))
pr_panic
(
"Can't restore registers (pid: %d)
\n
"
,
ctl
->
pid
);
jerr
(
fchmod
(
cr_fdset
->
desc
[
fd_type
].
fd
,
CR_FD_PERM
),
err
);
err:
pr_info
(
"----------------------------------------
\n
"
);
...
...
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