[CRIU] [PATCH 2/3 v2] service: call kerndat_init() before feature check

Andrei Vagin avagin at gmail.com
Mon Oct 15 19:16:14 MSK 2018


setup_opts_from_req() sets up logging and call kerndat_init().

Investigated-by: Adrian Reber <areber at redhat.com>
Fixes: 6e04f3b2dd06 ("criu: call kerndat_init() after log_init()")
Signed-off-by: Andrei Vagin <avagin at gmail.com>
---

v2: exit from a child process if setup_opts_from_req fails

 criu/cr-service.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/criu/cr-service.c b/criu/cr-service.c
index af9ccddd2..22ed7b503 100644
--- a/criu/cr-service.c
+++ b/criu/cr-service.c
@@ -971,6 +971,9 @@ static int handle_feature_check(int sk, CriuReq * msg)
 	}
 
 	if (pid == 0) {
+		/* kerndat_init() is called from setup_opts_from_req() */
+		if (setup_opts_from_req(sk, msg->opts))
+			exit(1);
 
 		setproctitle("feature-check --rpc");
 
@@ -994,7 +997,7 @@ static int handle_feature_check(int sk, CriuReq * msg)
 		 * be send from the parent process.
 		 */
 		ret = send_criu_msg(sk, &resp);
-		exit(ret);
+		exit(!!ret);
 	}
 	if (waitpid(pid, &status, 0) != pid) {
 		pr_perror("Unable to wait %d", pid);
-- 
2.14.4



More information about the CRIU mailing list