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: Pawel Stradomski <pstradomski@google.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Pawel Stradomski 2018-06-13 12:27:37 +02:00 committed by Andrei Vagin
parent 3abb6f5cd6
commit b735547d96

View file

@ -356,6 +356,7 @@ int main(int argc, char *argv[], char *envp[])
BOOL_OPT("remote", &opts.remote),
{ "config", required_argument, 0, 1089},
{ "no-default-config", no_argument, 0, 1090},
{ "ps-socket", required_argument, 0, 1091},
{ },
};
@ -684,6 +685,9 @@ int main(int argc, char *argv[], char *envp[])
break;
case 1090:
break;
case 1091:
opts.ps_socket = atoi(optarg);
break;
case 'V':
pr_msg("Version: %s\n", CRIU_VERSION);
if (strcmp(CRIU_GITID, "0"))