Commit 2e236dcf authored by Pawel Stradomski's avatar Pawel Stradomski Committed by Pavel Emelyanov

Allow passing ps-socket file descriptor when launching criu.

This makes it possible to have the pageserver communication go over anonymous
unix sockets, e.g. created by socketpair().

Such setup makes it easier to secure pageserver connection by wrapping
it in an encrypted tunnel. It also helps prevent attacks where
a malicious process connects to page server and injects its own
stream of pages to either fool criu into restoring wrong pages or
to DoS the pageserver by having it exhaust local storage by writing
large .img files.
Signed-off-by: 's avatarPawel Stradomski <pstradomski@google.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 339446a7
...@@ -311,6 +311,7 @@ int main(int argc, char *argv[], char *envp[]) ...@@ -311,6 +311,7 @@ int main(int argc, char *argv[], char *envp[])
{ "status-fd", required_argument, 0, 1088 }, { "status-fd", required_argument, 0, 1088 },
BOOL_OPT(SK_CLOSE_PARAM, &opts.tcp_close), BOOL_OPT(SK_CLOSE_PARAM, &opts.tcp_close),
{ "verbosity", optional_argument, 0, 'v' }, { "verbosity", optional_argument, 0, 'v' },
{ "ps-socket", required_argument, 0, 1091},
{ }, { },
}; };
...@@ -615,6 +616,9 @@ int main(int argc, char *argv[], char *envp[]) ...@@ -615,6 +616,9 @@ int main(int argc, char *argv[], char *envp[])
return 1; return 1;
} }
break; break;
case 1091:
opts.ps_socket = atoi(optarg);
break;
case 'V': case 'V':
pr_msg("Version: %s\n", CRIU_VERSION); pr_msg("Version: %s\n", CRIU_VERSION);
if (strcmp(CRIU_GITID, "0")) if (strcmp(CRIU_GITID, "0"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment