Commit 3200fa8f authored by Adrian Reber's avatar Adrian Reber Committed by Pavel Emelyanov

cr-service: feature check core dumps if criu_req->criu_opts is empty

Trying to use the FEATURE_CHECK RPC with criu_req->criu_opts set to NULL
makes CRIU segfault. Technically there is no reason to have a valid
criu_req->criu_opt during feature check. The only reason was to set the
image directory for setproctitle(). This removes the segfault and the
unnecessary requirement of setting criu_req->criu_opts.

Another possible solution would have been to return an error if
criu_req->criu_opts is NULL but so far it seems unnecessary to have
criu_req->criu_opts during feature check.
Signed-off-by: 's avatarAdrian Reber <areber@redhat.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent d0341845
...@@ -852,16 +852,13 @@ static int handle_feature_check(int sk, CriuReq * msg) ...@@ -852,16 +852,13 @@ static int handle_feature_check(int sk, CriuReq * msg)
if (pid == 0) { if (pid == 0) {
int ret = 1; int ret = 1;
if (setup_opts_from_req(sk, msg->opts)) setproctitle("feature-check --rpc");
goto cout;
setproctitle("feature-check --rpc -D %s", images_dir);
kerndat_get_dirty_track(); kerndat_get_dirty_track();
if (kdat.has_dirty_track) if (kdat.has_dirty_track)
ret = 0; ret = 0;
cout:
exit(ret); exit(ret);
} }
......
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