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
14a7aff2
Commit
14a7aff2
authored
Oct 11, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rst: Read sys.last_cap only once in kerndat
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
d393e5d1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
13 deletions
+23
-13
cr-restore.c
cr-restore.c
+2
-12
kerndat.h
include/kerndat.h
+2
-0
kerndat.c
kerndat.c
+19
-1
No files found.
cr-restore.c
View file @
14a7aff2
...
...
@@ -59,7 +59,6 @@
#include "cpu.h"
#include "file-lock.h"
#include "page-read.h"
#include "sysctl.h"
#include "vdso.h"
#include "stats.h"
#include "tun.h"
...
...
@@ -1934,17 +1933,6 @@ static int prepare_creds(int pid, struct task_restore_core_args *args)
int
fd
,
ret
;
CredsEntry
*
ce
;
struct
sysctl_req
req
[]
=
{
{
"kernel/cap_last_cap"
,
&
args
->
cap_last_cap
,
CTL_U32
},
{
},
};
ret
=
sysctl_op
(
req
,
CTL_READ
);
if
(
ret
<
0
)
{
pr_err
(
"Failed to read max IPC message size
\n
"
);
return
-
1
;
}
fd
=
open_image
(
CR_FD_CREDS
,
O_RSTR
,
pid
);
if
(
fd
<
0
)
return
fd
;
...
...
@@ -1988,6 +1976,8 @@ static int prepare_creds(int pid, struct task_restore_core_args *args)
creds_entry__free_unpacked
(
ce
,
NULL
);
args
->
cap_last_cap
=
kern_last_cap
;
/* XXX -- validate creds here? */
return
0
;
...
...
include/kerndat.h
View file @
14a7aff2
...
...
@@ -17,4 +17,6 @@ extern bool kerndat_has_dirty_track;
extern
int
tcp_max_wshare
;
extern
int
tcp_max_rshare
;
extern
int
kern_last_cap
;
#endif
kerndat.c
View file @
14a7aff2
...
...
@@ -156,13 +156,31 @@ int kerndat_init(void)
return
ret
;
}
int
kern_last_cap
;
int
get_last_cap
(
void
)
{
struct
sysctl_req
req
[]
=
{
{
"kernel/cap_last_cap"
,
&
kern_last_cap
,
CTL_U32
},
{
},
};
return
sysctl_op
(
req
,
CTL_READ
);
}
int
kerndat_init_rst
(
void
)
{
int
ret
;
/*
* Read TCP sysctls before anything else,
* since the limits we're interested in are
* not available inside namespaces.
*/
return
tcp_read_sysctl_limits
();
ret
=
tcp_read_sysctl_limits
();
if
(
!
ret
)
ret
=
get_last_cap
();
return
ret
;
}
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