[CRIU] [PATCH] cr-service: feature check core dumps if criu_req->criu_opts is empty

Adrian Reber adrian at lisas.de
Tue Feb 14 09:34:55 PST 2017


From: Adrian Reber <areber at redhat.com>

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: Adrian Reber <areber at redhat.com>
---
 criu/cr-service.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/criu/cr-service.c b/criu/cr-service.c
index fd41450..ff5a7a8 100644
--- a/criu/cr-service.c
+++ b/criu/cr-service.c
@@ -859,16 +859,13 @@ static int handle_feature_check(int sk, CriuReq * msg)
 	if (pid == 0) {
 		int ret = 1;
 
-		if (setup_opts_from_req(sk, msg->opts))
-			goto cout;
-
-		setproctitle("feature-check --rpc -D %s", images_dir);
+		setproctitle("feature-check --rpc");
 
 		kerndat_get_dirty_track();
 
 		if (kdat.has_dirty_track)
 			ret = 0;
-cout:
+
 		exit(ret);
 	}
 
-- 
2.9.3



More information about the CRIU mailing list