Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1]
criu-4.1.1/criu/cr-check.c:141:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ns.<Uc460>.net.nlsk’
criu-4.1.1/criu/cr-check.c:135:23: acquire_resource: socket created here
criu-4.1.1/criu/cr-check.c:136:12: branch_false: following ‘false’ branch...
criu-4.1.1/criu/cr-check.c:141:15: branch_false: ...to here
criu-4.1.1/criu/cr-check.c:141:15: throw: if ‘collect_sockets’ throws an exception...
criu-4.1.1/criu/cr-check.c:141:15: danger: ‘ns.<Uc460>.net.nlsk’ leaks here
#  139|   	}
#  140|   
#  141|-> 	ret = collect_sockets(&ns);
#  142|   	if (!ret)
#  143|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2]
criu-4.1.1/criu/cr-dump.c:1399:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.1.1/criu/cr-dump.c:1378:9: branch_true: following ‘true’ branch (when ‘item’ is non-NULL)...
criu-4.1.1/criu/cr-dump.c:1379:21: branch_true: ...to here
criu-4.1.1/criu/cr-dump.c:1393:20: branch_false: following ‘false’ branch...
criu-4.1.1/criu/cr-dump.c:1396:29: branch_false: ...to here
criu-4.1.1/criu/cr-dump.c:1399:17: branch_true: following ‘true’ branch...
criu-4.1.1/criu/cr-dump.c:1399:17: branch_true: ...to here
criu-4.1.1/criu/cr-dump.c:1399:17: danger: dereference of NULL ‘0’
# 1397|   		item->pgid = pps_buf.pgid;
# 1398|   
# 1399|-> 		BUG_ON(!list_empty(&item->children));
# 1400|   
# 1401|   		if (!item->sid) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
criu-4.1.1/criu/cr-service.c:332:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[1]’
criu-4.1.1/criu/cr-service.c:999:12: enter_function: entry to ‘start_page_server_req’
criu-4.1.1/criu/cr-service.c:1008:12: branch_false: following ‘false’ branch...
criu-4.1.1/criu/cr-service.c:1013:15: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1014:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.1.1/criu/cr-service.c:1015:17: branch_true: ...to here
criu-4.1.1/criu/cr-service.c:1018:21: call_function: calling ‘setup_opts_from_req’ from ‘start_page_server_req’
#  330|   
#  331|   		rpc_cfg_file = req->config_file;
#  332|-> 		i = parse_options(0, NULL, &dummy, &dummy, PARSING_RPC_CONF);
#  333|   		if (i) {
#  334|   			xfree(tmp_output);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def4]
criu-4.1.1/criu/cr-service.c:390:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[1]’
criu-4.1.1/criu/cr-service.c:999:12: enter_function: entry to ‘start_page_server_req’
criu-4.1.1/criu/cr-service.c:1008:12: branch_false: following ‘false’ branch...
criu-4.1.1/criu/cr-service.c:1013:15: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1014:12: branch_true: following ‘true’ branch (when ‘pid == 0’)...
criu-4.1.1/criu/cr-service.c:1015:17: branch_true: ...to here
criu-4.1.1/criu/cr-service.c:1018:21: call_function: calling ‘setup_opts_from_req’ from ‘start_page_server_req’
#  388|   		strncpy(images_dir_path, req->images_dir, PATH_MAX - 1);
#  389|   	else {
#  390|-> 		pr_err("Neither images_dir_fd nor images_dir was passed by RPC client.\n");
#  391|   		goto err;
#  392|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
criu-4.1.1/criu/cr-service.c:1046:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[(int)ps.has_port]’
criu-4.1.1/criu/cr-service.c:1008:12: branch_false: following ‘false’ branch...
criu-4.1.1/criu/cr-service.c:1013:15: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1014:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.1.1/criu/cr-service.c:1046:9: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1046:9: throw: if ‘close’ throws an exception...
criu-4.1.1/criu/cr-service.c:1046:9: danger: ‘start_pipe[(int)ps.has_port]’ leaks here
# 1044|   	}
# 1045|   
# 1046|-> 	close(start_pipe[1]);
# 1047|   
# 1048|   	if (daemon_mode) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def6]
criu-4.1.1/criu/cr-service.c:1046:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[1]’
criu-4.1.1/criu/cr-service.c:1008:12: branch_false: following ‘false’ branch...
criu-4.1.1/criu/cr-service.c:1013:15: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1014:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.1.1/criu/cr-service.c:1046:9: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1046:9: throw: if ‘close’ throws an exception...
criu-4.1.1/criu/cr-service.c:1046:9: danger: ‘start_pipe[1]’ leaks here
# 1044|   	}
# 1045|   
# 1046|-> 	close(start_pipe[1]);
# 1047|   
# 1048|   	if (daemon_mode) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
criu-4.1.1/criu/cr-service.c:1049:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[(int)ps.has_port]’
criu-4.1.1/criu/cr-service.c:1008:12: branch_false: following ‘false’ branch...
criu-4.1.1/criu/cr-service.c:1013:15: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1014:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.1.1/criu/cr-service.c:1046:9: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1048:12: branch_true: following ‘true’ branch (when ‘daemon_mode != 0’)...
criu-4.1.1/criu/cr-service.c:1049:21: branch_true: ...to here
criu-4.1.1/criu/cr-service.c:1049:21: throw: if ‘waitpid’ throws an exception...
criu-4.1.1/criu/cr-service.c:1049:21: danger: ‘start_pipe[(int)ps.has_port]’ leaks here
# 1047|   
# 1048|   	if (daemon_mode) {
# 1049|-> 		if (waitpid(pid, &ret, 0) != pid) {
# 1050|   			pr_perror("Unable to wait %d", pid);
# 1051|   			goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def8]
criu-4.1.1/criu/cr-service.c:1050:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[(int)ps.has_port]’
criu-4.1.1/criu/cr-service.c:1008:12: branch_false: following ‘false’ branch...
criu-4.1.1/criu/cr-service.c:1013:15: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1014:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.1.1/criu/cr-service.c:1046:9: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1048:12: branch_true: following ‘true’ branch (when ‘daemon_mode != 0’)...
criu-4.1.1/criu/cr-service.c:1049:21: branch_true: ...to here
criu-4.1.1/criu/cr-service.c:1049:20: branch_true: following ‘true’ branch...
criu-4.1.1/criu/cr-service.c:1050:25: branch_true: ...to here
criu-4.1.1/criu/cr-service.c:1050:25: throw: if ‘print_on_level’ throws an exception...
criu-4.1.1/criu/cr-service.c:1050:25: danger: ‘start_pipe[(int)ps.has_port]’ leaks here
# 1048|   	if (daemon_mode) {
# 1049|   		if (waitpid(pid, &ret, 0) != pid) {
# 1050|-> 			pr_perror("Unable to wait %d", pid);
# 1051|   			goto out;
# 1052|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def9]
criu-4.1.1/criu/cr-service.c:1055:33: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[(int)ps.has_port]’
criu-4.1.1/criu/cr-service.c:1008:12: branch_false: following ‘false’ branch...
criu-4.1.1/criu/cr-service.c:1013:15: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1014:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.1.1/criu/cr-service.c:1046:9: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1048:12: branch_true: following ‘true’ branch (when ‘daemon_mode != 0’)...
criu-4.1.1/criu/cr-service.c:1049:21: branch_true: ...to here
criu-4.1.1/criu/cr-service.c:1049:20: branch_false: following ‘false’ branch...
criu-4.1.1/criu/cr-service.c:1053:21: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1053:20: branch_true: following ‘true’ branch...
criu-4.1.1/criu/cr-service.c:1054:29: branch_true: ...to here
criu-4.1.1/criu/cr-service.c:1054:28: branch_true: following ‘true’ branch...
criu-4.1.1/criu/cr-service.c:1055:33: branch_true: ...to here
criu-4.1.1/criu/cr-service.c:1055:33: throw: if ‘print_on_level’ throws an exception...
criu-4.1.1/criu/cr-service.c:1055:33: danger: ‘start_pipe[(int)ps.has_port]’ leaks here
# 1053|   		if (WIFEXITED(ret)) {
# 1054|   			if (WEXITSTATUS(ret)) {
# 1055|-> 				pr_err("Child exited with an error\n");
# 1056|   				goto out;
# 1057|   			}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def10]
criu-4.1.1/criu/cr-service.c:1059:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[(int)ps.has_port]’
criu-4.1.1/criu/cr-service.c:1008:12: branch_false: following ‘false’ branch...
criu-4.1.1/criu/cr-service.c:1013:15: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1014:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.1.1/criu/cr-service.c:1046:9: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1048:12: branch_true: following ‘true’ branch (when ‘daemon_mode != 0’)...
criu-4.1.1/criu/cr-service.c:1049:21: branch_true: ...to here
criu-4.1.1/criu/cr-service.c:1049:20: branch_false: following ‘false’ branch...
criu-4.1.1/criu/cr-service.c:1053:21: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1053:20: branch_false: following ‘false’ branch...
criu-4.1.1/criu/cr-service.c:1059:25: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1059:25: throw: if ‘print_on_level’ throws an exception...
criu-4.1.1/criu/cr-service.c:1059:25: danger: ‘start_pipe[(int)ps.has_port]’ leaks here
# 1057|   			}
# 1058|   		} else {
# 1059|-> 			pr_err("Child wasn't terminated normally\n");
# 1060|   			goto out;
# 1061|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def11]
criu-4.1.1/criu/cr-service.c:1065:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘start_pipe[(int)ps.has_port]’
criu-4.1.1/criu/cr-service.c:1008:12: branch_false: following ‘false’ branch...
criu-4.1.1/criu/cr-service.c:1013:15: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1014:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
criu-4.1.1/criu/cr-service.c:1046:9: branch_false: ...to here
criu-4.1.1/criu/cr-service.c:1065:9: throw: if ‘close’ throws an exception...
criu-4.1.1/criu/cr-service.c:1065:9: danger: ‘start_pipe[(int)ps.has_port]’ leaks here
# 1063|   
# 1064|   	count = read(start_pipe[0], &info, sizeof(info));
# 1065|-> 	close(start_pipe[0]);
# 1066|   	if (count != sizeof(info))
# 1067|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def12]
criu-4.1.1/criu/files.c:1332:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
criu-4.1.1/criu/files.c:1332:9: branch_true: following ‘true’ branch...
criu-4.1.1/criu/files.c:1332:9: branch_true: ...to here
criu-4.1.1/criu/files.c:1332:9: danger: dereference of NULL ‘0’
# 1330|   	}
# 1331|   
# 1332|-> 	BUG_ON(current->pid->state == TASK_HELPER);
# 1333|   	ret = open_fdinfos(me);
# 1334|   

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.92.0
diffbase-analyzer-version-cppcheck2.19.1
diffbase-analyzer-version-gcc16.0.0
diffbase-analyzer-version-gcc-analyzer16.0.0
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-134.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namecriu-4.2-11.fc44
diffbase-store-results-to/tmp/tmpwiv_zemz/criu-4.2-11.fc44.tar.xz
diffbase-time-created2026-01-08 15:53:33
diffbase-time-finished2026-01-08 15:57:08
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpwiv_zemz/criu-4.2-11.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpwiv_zemz/criu-4.2-11.fc44.src.rpm'
diffbase-tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-134.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namecriu-4.1.1-2.fc43
store-results-to/tmp/tmppj9wavkw/criu-4.1.1-2.fc43.tar.xz
time-created2026-01-08 15:48:47
time-finished2026-01-08 15:52:53
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmppj9wavkw/criu-4.1.1-2.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmppj9wavkw/criu-4.1.1-2.fc43.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9