conmon-2.2.1-2.fc45

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1]
conmon-2.2.1/src/cgroup.c:164:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(process_cgroup_subsystem_path(pid, 0, "memory"), "cgroup.event_control", 0), 524289)’
conmon-2.2.1/src/cgroup.c:142:13: enter_function: entry to ‘setup_oom_handling_cgroup_v1’
conmon-2.2.1/src/cgroup.c:145:51: call_function: calling ‘process_cgroup_subsystem_path’ from ‘setup_oom_handling_cgroup_v1’
conmon-2.2.1/src/cgroup.c:145:51: return_function: returning to ‘setup_oom_handling_cgroup_v1’ from ‘process_cgroup_subsystem_path’
conmon-2.2.1/src/cgroup.c:146:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/cgroup.c:152:41: branch_false: ...to here
conmon-2.2.1/src/cgroup.c:153:35: acquire_resource: opened here
conmon-2.2.1/src/cgroup.c:154:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/cgroup.c:160:60: branch_false: ...to here
conmon-2.2.1/src/cgroup.c:163:12: branch_true: following ‘true’ branch...
conmon-2.2.1/src/cgroup.c:164:17: branch_true: ...to here
conmon-2.2.1/src/cgroup.c:164:17: danger: ‘open(g_build_filename(process_cgroup_subsystem_path(pid, 0, "memory"), "cgroup.event_control", 0), 524289)’ leaks here; was opened at [(25)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/24)
#  162|   	oom_cgroup_fd = open(memory_cgroup_file_oom_path, O_RDONLY | O_CLOEXEC); /* Not closed */
#  163|   	if (oom_cgroup_fd == -1)
#  164|-> 		pexitf("Failed to open %s", memory_cgroup_file_oom_path);
#  165|   
#  166|   	if ((oom_event_fd = eventfd(0, EFD_CLOEXEC)) == -1)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
conmon-2.2.1/src/cgroup.c:167:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(g_build_filename(process_cgroup_subsystem_path(pid, 0, "memory"), "cgroup.event_control", 0), 524289)’
conmon-2.2.1/src/cgroup.c:142:13: enter_function: entry to ‘setup_oom_handling_cgroup_v1’
conmon-2.2.1/src/cgroup.c:145:51: call_function: calling ‘process_cgroup_subsystem_path’ from ‘setup_oom_handling_cgroup_v1’
conmon-2.2.1/src/cgroup.c:145:51: return_function: returning to ‘setup_oom_handling_cgroup_v1’ from ‘process_cgroup_subsystem_path’
conmon-2.2.1/src/cgroup.c:146:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/cgroup.c:152:41: branch_false: ...to here
conmon-2.2.1/src/cgroup.c:153:35: acquire_resource: opened here
conmon-2.2.1/src/cgroup.c:154:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/cgroup.c:160:60: branch_false: ...to here
conmon-2.2.1/src/cgroup.c:163:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/cgroup.c:166:29: branch_false: ...to here
conmon-2.2.1/src/cgroup.c:166:12: branch_true: following ‘true’ branch...
conmon-2.2.1/src/cgroup.c:167:17: branch_true: ...to here
conmon-2.2.1/src/cgroup.c:167:17: danger: ‘open(g_build_filename(process_cgroup_subsystem_path(pid, 0, "memory"), "cgroup.event_control", 0), 524289)’ leaks here; was opened at [(25)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/24)
#  165|   
#  166|   	if ((oom_event_fd = eventfd(0, EFD_CLOEXEC)) == -1)
#  167|-> 		pexit("Failed to create eventfd");
#  168|   
#  169|   	_cleanup_free_ char *data = g_strdup_printf("%d %d", oom_event_fd, oom_cgroup_fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
conmon-2.2.1/src/conmon.c:29:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(dev_null_r, 0)’
conmon-2.2.1/src/conmon.c:29:13: acquire_resource: opened here
conmon-2.2.1/src/conmon.c:29:12: danger: ‘dup2(dev_null_r, 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   27|   static void disconnect_std_streams(int dev_null_r, int dev_null_w)
#   28|   {
#   29|-> 	if (dup2(dev_null_r, STDIN_FILENO) < 0)
#   30|   		pexit("Failed to dup over stdin");
#   31|   	if (dup2(dev_null_w, STDOUT_FILENO) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def4]
conmon-2.2.1/src/conmon.c:31:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(dev_null_w, 1)’
conmon-2.2.1/src/conmon.c:29:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:31:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:31:13: acquire_resource: opened here
conmon-2.2.1/src/conmon.c:31:12: danger: ‘dup2(dev_null_w, 1)’ leaks here; was opened at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   29|   	if (dup2(dev_null_r, STDIN_FILENO) < 0)
#   30|   		pexit("Failed to dup over stdin");
#   31|-> 	if (dup2(dev_null_w, STDOUT_FILENO) < 0)
#   32|   		pexit("Failed to dup over stdout");
#   33|   	if (dup2(dev_null_w, STDERR_FILENO) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
conmon-2.2.1/src/conmon.c:33:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(dev_null_w, 2)’
conmon-2.2.1/src/conmon.c:29:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:31:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:31:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:33:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:33:13: acquire_resource: opened here
conmon-2.2.1/src/conmon.c:33:12: danger: ‘dup2(dev_null_w, 2)’ leaks here; was opened at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#   31|   	if (dup2(dev_null_w, STDOUT_FILENO) < 0)
#   32|   		pexit("Failed to dup over stdout");
#   33|-> 	if (dup2(dev_null_w, STDERR_FILENO) < 0)
#   34|   		pexit("Failed to dup over stderr");
#   35|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def6]
conmon-2.2.1/src/conmon.c:244:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(workerfd_stdin, 0)’
conmon-2.2.1/src/conmon.c:51:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:55:9: branch_false: ...to here
conmon-2.2.1/src/conmon.c:80:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:83:43: branch_false: ...to here
conmon-2.2.1/src/conmon.c:84:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:90:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:139:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:149:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:149:12: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:150:26: branch_true: ...to here
conmon-2.2.1/src/conmon.c:181:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:193:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:193:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:196:25: branch_false: ...to here
conmon-2.2.1/src/conmon.c:216:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:216:13: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:228:22: branch_false: ...to here
conmon-2.2.1/src/conmon.c:229:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:231:20: branch_false: ...to here
conmon-2.2.1/src/conmon.c:231:19: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:232:21: branch_true: ...to here
conmon-2.2.1/src/conmon.c:232:20: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:234:21: branch_false: ...to here
conmon-2.2.1/src/conmon.c:234:20: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:237:22: branch_false: ...to here
conmon-2.2.1/src/conmon.c:237:20: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:242:28: branch_true: ...to here
conmon-2.2.1/src/conmon.c:242:28: branch_true: following ‘true’ branch (when ‘workerfd_stdin < 0’)...
conmon-2.2.1/src/conmon.c:243:33: branch_true: ...to here
conmon-2.2.1/src/conmon.c:244:29: acquire_resource: opened here
conmon-2.2.1/src/conmon.c:244:28: danger: ‘dup2(workerfd_stdin, 0)’ leaks here; was opened at [(32)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/31)
#  242|   			if (workerfd_stdin < 0)
#  243|   				workerfd_stdin = dev_null_r;
#  244|-> 			if (dup2(workerfd_stdin, STDIN_FILENO) < 0)
#  245|   				_pexit("Failed to dup over stdin");
#  246|   			if (workerfd_stdin != dev_null_r && fchmod(STDIN_FILENO, 0777) < 0 && errno != EINVAL)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
conmon-2.2.1/src/conmon.c:251:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(workerfd_stdout, 1)’
conmon-2.2.1/src/conmon.c:51:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:55:9: branch_false: ...to here
conmon-2.2.1/src/conmon.c:80:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:83:43: branch_false: ...to here
conmon-2.2.1/src/conmon.c:84:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:90:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:139:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:149:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:149:12: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:150:26: branch_true: ...to here
conmon-2.2.1/src/conmon.c:181:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:193:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:193:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:196:25: branch_false: ...to here
conmon-2.2.1/src/conmon.c:216:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:216:13: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:228:22: branch_false: ...to here
conmon-2.2.1/src/conmon.c:229:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:231:20: branch_false: ...to here
conmon-2.2.1/src/conmon.c:231:19: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:232:21: branch_true: ...to here
conmon-2.2.1/src/conmon.c:232:20: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:234:21: branch_false: ...to here
conmon-2.2.1/src/conmon.c:234:20: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:237:22: branch_false: ...to here
conmon-2.2.1/src/conmon.c:237:20: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:242:28: branch_true: ...to here
conmon-2.2.1/src/conmon.c:242:28: branch_true: following ‘true’ branch (when ‘workerfd_stdin < 0’)...
conmon-2.2.1/src/conmon.c:243:33: branch_true: ...to here
conmon-2.2.1/src/conmon.c:244:28: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:246:29: branch_false: ...to here
conmon-2.2.1/src/conmon.c:246:28: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:249:28: branch_false: ...to here
conmon-2.2.1/src/conmon.c:249:28: branch_true: following ‘true’ branch (when ‘workerfd_stdout < 0’)...
conmon-2.2.1/src/conmon.c:250:33: branch_true: ...to here
conmon-2.2.1/src/conmon.c:251:29: acquire_resource: opened here
conmon-2.2.1/src/conmon.c:251:28: danger: ‘dup2(workerfd_stdout, 1)’ leaks here; was opened at [(38)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/37)
#  249|   			if (workerfd_stdout < 0)
#  250|   				workerfd_stdout = dev_null_w;
#  251|-> 			if (dup2(workerfd_stdout, STDOUT_FILENO) < 0)
#  252|   				_pexit("Failed to dup over stdout");
#  253|   			if (workerfd_stdout != dev_null_w && fchmod(STDOUT_FILENO, 0777) < 0 && errno != EINVAL)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def8]
conmon-2.2.1/src/conmon.c:256:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(workerfd_stderr, 2)’
conmon-2.2.1/src/conmon.c:51:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:55:9: branch_false: ...to here
conmon-2.2.1/src/conmon.c:80:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:83:43: branch_false: ...to here
conmon-2.2.1/src/conmon.c:84:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:90:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:139:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:149:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:149:12: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:150:26: branch_true: ...to here
conmon-2.2.1/src/conmon.c:181:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:193:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:193:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:196:25: branch_false: ...to here
conmon-2.2.1/src/conmon.c:216:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:216:13: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:228:22: branch_false: ...to here
conmon-2.2.1/src/conmon.c:229:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:231:20: branch_false: ...to here
conmon-2.2.1/src/conmon.c:231:19: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:232:21: branch_true: ...to here
conmon-2.2.1/src/conmon.c:232:20: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:234:21: branch_false: ...to here
conmon-2.2.1/src/conmon.c:234:20: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:237:22: branch_false: ...to here
conmon-2.2.1/src/conmon.c:237:20: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:242:28: branch_true: ...to here
conmon-2.2.1/src/conmon.c:242:28: branch_true: following ‘true’ branch (when ‘workerfd_stdin < 0’)...
conmon-2.2.1/src/conmon.c:243:33: branch_true: ...to here
conmon-2.2.1/src/conmon.c:244:28: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:246:29: branch_false: ...to here
conmon-2.2.1/src/conmon.c:246:28: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:249:28: branch_false: ...to here
conmon-2.2.1/src/conmon.c:249:28: branch_true: following ‘true’ branch (when ‘workerfd_stdout < 0’)...
conmon-2.2.1/src/conmon.c:250:33: branch_true: ...to here
conmon-2.2.1/src/conmon.c:251:28: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:253:29: branch_false: ...to here
conmon-2.2.1/src/conmon.c:253:28: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:256:29: branch_false: ...to here
conmon-2.2.1/src/conmon.c:256:29: acquire_resource: opened here
conmon-2.2.1/src/conmon.c:256:28: danger: ‘dup2(workerfd_stderr, 2)’ leaks here; was opened at [(42)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/41)
#  254|   				nwarn("Failed to chmod stdout");
#  255|   
#  256|-> 			if (dup2(workerfd_stderr, STDERR_FILENO) < 0)
#  257|   				_pexit("Failed to dup over stderr");
#  258|   			if (workerfd_stderr != dev_null_w && fchmod(STDERR_FILENO, 0777) < 0 && errno != EINVAL)

Error: GCC_ANALYZER_WARNING (CWE-910): [#def9]
conmon-2.2.1/src/conmon.c:285:44: warning[-Wanalyzer-fd-use-after-close]: ‘read’ on closed file descriptor ‘get_pipe_fd_from_env("_OCI_STARTPIPE")’
conmon-2.2.1/src/conmon.c:51:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:55:9: branch_false: ...to here
conmon-2.2.1/src/conmon.c:65:12: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:69:28: branch_true: ...to here
conmon-2.2.1/src/conmon.c:70:20: branch_false: following ‘false’ branch (when ‘num_read >= 0’)...
conmon-2.2.1/src/conmon.c:75:21: branch_false: ...to here
conmon-2.2.1/src/conmon.c:75:20: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:76:25: branch_true: ...to here
conmon-2.2.1/src/conmon.c:76:25: release_resource: closed here
conmon-2.2.1/src/conmon.c:80:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:83:43: branch_false: ...to here
conmon-2.2.1/src/conmon.c:84:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:90:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:139:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:149:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:149:12: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:150:26: branch_true: ...to here
conmon-2.2.1/src/conmon.c:181:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:193:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:193:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:196:25: branch_false: ...to here
conmon-2.2.1/src/conmon.c:216:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:216:13: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:228:22: branch_false: ...to here
conmon-2.2.1/src/conmon.c:229:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:231:20: branch_false: ...to here
conmon-2.2.1/src/conmon.c:231:19: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:232:21: branch_true: ...to here
conmon-2.2.1/src/conmon.c:232:20: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:234:21: branch_false: ...to here
conmon-2.2.1/src/conmon.c:234:20: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:237:22: branch_false: ...to here
conmon-2.2.1/src/conmon.c:282:20: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:283:28: branch_true: ...to here
conmon-2.2.1/src/conmon.c:283:28: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:284:33: branch_true: ...to here
conmon-2.2.1/src/conmon.c:285:44: danger: ‘read’ on closed file descriptor ‘get_pipe_fd_from_env("_OCI_STARTPIPE")’; ‘close’ was at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
#  283|   			if (start_pipe_fd > 0) {
#  284|   				ndebug("exec with attach is waiting for start message from parent");
#  285|-> 				num_read = read(start_pipe_fd, buf, BUF_SIZE);
#  286|   				if (num_read < 0) {
#  287|   					_pexit("start-pipe read failed");

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def10]
conmon-2.2.1/src/conmon.c:290:33: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘get_pipe_fd_from_env("_OCI_STARTPIPE")’
conmon-2.2.1/src/conmon.c:51:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:55:9: branch_false: ...to here
conmon-2.2.1/src/conmon.c:65:12: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:69:28: branch_true: ...to here
conmon-2.2.1/src/conmon.c:70:20: branch_false: following ‘false’ branch (when ‘num_read >= 0’)...
conmon-2.2.1/src/conmon.c:75:21: branch_false: ...to here
conmon-2.2.1/src/conmon.c:75:20: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:76:25: branch_true: ...to here
conmon-2.2.1/src/conmon.c:76:25: release_resource: first ‘close’ here
conmon-2.2.1/src/conmon.c:80:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:83:43: branch_false: ...to here
conmon-2.2.1/src/conmon.c:84:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:90:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:139:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:149:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:149:12: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:150:26: branch_true: ...to here
conmon-2.2.1/src/conmon.c:181:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:193:13: branch_false: ...to here
conmon-2.2.1/src/conmon.c:193:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:196:25: branch_false: ...to here
conmon-2.2.1/src/conmon.c:216:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:216:13: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:228:22: branch_false: ...to here
conmon-2.2.1/src/conmon.c:229:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:231:20: branch_false: ...to here
conmon-2.2.1/src/conmon.c:231:19: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:232:21: branch_true: ...to here
conmon-2.2.1/src/conmon.c:232:20: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:234:21: branch_false: ...to here
conmon-2.2.1/src/conmon.c:234:20: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conmon.c:237:22: branch_false: ...to here
conmon-2.2.1/src/conmon.c:282:20: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:283:28: branch_true: ...to here
conmon-2.2.1/src/conmon.c:283:28: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conmon.c:284:33: branch_true: ...to here
conmon-2.2.1/src/conmon.c:286:36: branch_false: following ‘false’ branch (when ‘num_read >= 0’)...
conmon-2.2.1/src/conmon.c:289:33: branch_false: ...to here
conmon-2.2.1/src/conmon.c:290:33: danger: second ‘close’ here; first ‘close’ was at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
#  288|   				}
#  289|   				ndebug("exec with attach got start message from parent");
#  290|-> 				close(start_pipe_fd);
#  291|   			}
#  292|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
conmon-2.2.1/src/conn_sock.c:177:25: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(path)’
conmon-2.2.1/src/conn_sock.c:168:12: branch_true: following ‘true’ branch (when ‘path’ is non-NULL)...
conmon-2.2.1/src/conn_sock.c:173:26: branch_true: ...to here
conmon-2.2.1/src/conn_sock.c:174:29: acquire_memory: allocated here
conmon-2.2.1/src/conn_sock.c:176:20: branch_true: following ‘true’ branch (when ‘csname’ is NULL)...
conmon-2.2.1/src/conn_sock.c:177:25: branch_true: ...to here
conmon-2.2.1/src/conn_sock.c:177:25: danger: ‘strdup(path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  175|   		bname_buf = strdup(path);
#  176|   		if (csname == NULL || dname_buf == NULL || bname_buf == NULL) {
#  177|-> 			pexit("Failed to allocate memory");
#  178|   			return NULL;
#  179|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
conmon-2.2.1/src/conn_sock.c:182:25: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(path)’
conmon-2.2.1/src/conn_sock.c:168:12: branch_true: following ‘true’ branch (when ‘path’ is non-NULL)...
conmon-2.2.1/src/conn_sock.c:173:26: branch_true: ...to here
conmon-2.2.1/src/conn_sock.c:175:29: acquire_memory: allocated here
conmon-2.2.1/src/conn_sock.c:176:20: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conn_sock.c:176:21: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conn_sock.c:180:25: branch_false: ...to here
conmon-2.2.1/src/conn_sock.c:181:20: branch_true: following ‘true’ branch (when ‘dname’ is NULL)...
conmon-2.2.1/src/conn_sock.c:182:25: branch_true: ...to here
conmon-2.2.1/src/conn_sock.c:182:25: danger: ‘strdup(path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  180|   		dname = dirname(dname_buf);
#  181|   		if (dname == NULL)
#  182|-> 			pexitf("Cannot get dirname for %s", csname);
#  183|   
#  184|   		sfd = open(dname, O_CREAT | O_PATH | O_CLOEXEC, 0600);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
conmon-2.2.1/src/conn_sock.c:186:25: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(path)’
conmon-2.2.1/src/conn_sock.c:168:12: branch_true: following ‘true’ branch (when ‘path’ is non-NULL)...
conmon-2.2.1/src/conn_sock.c:173:26: branch_true: ...to here
conmon-2.2.1/src/conn_sock.c:175:29: acquire_memory: allocated here
conmon-2.2.1/src/conn_sock.c:176:20: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conn_sock.c:176:21: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conn_sock.c:180:25: branch_false: ...to here
conmon-2.2.1/src/conn_sock.c:181:20: branch_false: following ‘false’ branch (when ‘dname’ is non-NULL)...
conmon-2.2.1/src/conn_sock.c:184:23: branch_false: ...to here
conmon-2.2.1/src/conn_sock.c:185:20: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conn_sock.c:186:25: branch_true: ...to here
conmon-2.2.1/src/conn_sock.c:186:25: danger: ‘strdup(path)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  184|   		sfd = open(dname, O_CREAT | O_PATH | O_CLOEXEC, 0600);
#  185|   		if (sfd < 0)
#  186|-> 			pexit("Failed to create file for console-socket");
#  187|   
#  188|   		bname = basename(bname_buf);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def14]
conmon-2.2.1/src/conn_sock.c:215:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*fd’
conmon-2.2.1/src/conn_sock.c:162:14: enter_function: entry to ‘setup_socket’
conmon-2.2.1/src/conn_sock.c:168:12: branch_false: following ‘false’ branch (when ‘path’ is NULL)...
conmon-2.2.1/src/conn_sock.c:192:53: branch_false: ...to here
conmon-2.2.1/src/conn_sock.c:200:20: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conn_sock.c:202:17: branch_false: ...to here
conmon-2.2.1/src/conn_sock.c:204:20: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conn_sock.c:192:44: call_function: inlined call to ‘freep’ from ‘setup_socket’
conmon-2.2.1/src/conn_sock.c:212:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conn_sock.c:214:9: branch_false: ...to here
conmon-2.2.1/src/conn_sock.c:214:9: call_function: calling ‘bind_relative_to_dir’ from ‘setup_socket’
conmon-2.2.1/src/conn_sock.c:214:9: return_function: returning to ‘setup_socket’ from ‘bind_relative_to_dir’
conmon-2.2.1/src/conn_sock.c:215:13: danger: ‘*fd’ leaks here
#  213|   		pexit("Failed to create socket");
#  214|   	bind_relative_to_dir(sfd, *fd, bname);
#  215|-> 	if (listen(*fd, 128) < 0)
#  216|   		pexit("Failed to listen on console-socket");
#  217|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def15]
conmon-2.2.1/src/conn_sock.c:277:45: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘socket_parent_dir(use_full_attach_path, 108)’ where non-null expected
conmon-2.2.1/src/conn_sock.c:263:14: enter_function: entry to ‘bind_unix_socket’
conmon-2.2.1/src/conn_sock.c:269:43: call_function: calling ‘socket_parent_dir’ from ‘bind_unix_socket’
conmon-2.2.1/src/conn_sock.c:269:43: return_function: returning to ‘bind_unix_socket’ from ‘socket_parent_dir’
conmon-2.2.1/src/conn_sock.c:277:45: danger: argument 1 (‘socket_parent_dir(use_full_attach_path, 108)’) from [(6)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/5) could be NULL where non-null expected
#  275|   	 * to actually refer to the file where the socket will be created below.
#  276|   	 */
#  277|-> 	_cleanup_close_ int parent_dir_fd = open(parent_dir, O_PATH | O_CLOEXEC);
#  278|   	if (parent_dir_fd < 0)
#  279|   		pexitf("failed to open socket path parent dir %s", parent_dir);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def16]
conmon-2.2.1/src/conn_sock.c:294:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(socket_parent_dir(use_full_attach_path, 108), 2621440)’
conmon-2.2.1/src/conn_sock.c:263:14: enter_function: entry to ‘bind_unix_socket’
conmon-2.2.1/src/conn_sock.c:269:43: call_function: calling ‘socket_parent_dir’ from ‘bind_unix_socket’
conmon-2.2.1/src/conn_sock.c:269:43: return_function: returning to ‘bind_unix_socket’ from ‘socket_parent_dir’
conmon-2.2.1/src/conn_sock.c:277:45: acquire_resource: opened here
conmon-2.2.1/src/conn_sock.c:278:12: branch_false: following ‘false’ branch...
conmon-2.2.1/src/conn_sock.c:285:31: branch_false: ...to here
conmon-2.2.1/src/conn_sock.c:293:12: branch_true: following ‘true’ branch (when ‘socket_fd == -1’)...
conmon-2.2.1/src/conn_sock.c:294:17: branch_true: ...to here
conmon-2.2.1/src/conn_sock.c:294:17: danger: ‘open(socket_parent_dir(use_full_attach_path, 108), 2621440)’ leaks here; was opened at [(7)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/6)
#  292|   	socket_fd = socket(AF_UNIX, sock_type, 0);
#  293|   	if (socket_fd == -1)
#  294|-> 		pexitf("Failed to create socket %s", sock_fullpath);
#  295|   
#  296|   	if (unlink(sock_fullpath) == -1 && errno != ENOENT)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
conmon-2.2.1/src/conn_sock.c:320:24: warning[-Wanalyzer-malloc-leak]: leak of ‘socket_parent_dir(use_full_attach_path, 108)’
conmon-2.2.1/src/conn_sock.c:263:14: enter_function: entry to ‘bind_unix_socket’
conmon-2.2.1/src/conn_sock.c:269:43: call_function: calling ‘socket_parent_dir’ from ‘bind_unix_socket’
conmon-2.2.1/src/conn_sock.c:269:43: return_function: returning to ‘bind_unix_socket’ from ‘socket_parent_dir’
conmon-2.2.1/src/conn_sock.c:278:12: branch_true: following ‘true’ branch...
conmon-2.2.1/src/conn_sock.c:279:17: branch_true: ...to here
conmon-2.2.1/src/conn_sock.c:320:24: danger: ‘socket_parent_dir(use_full_attach_path, 108)’ leaks here; was allocated at [(6)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/5)
#  318|   	/* if we're to use the full path, ignore the socket path and only use the bundle_path */
#  319|   	if (use_full_attach_path)
#  320|-> 		return strdup(opt_bundle_path);
#  321|   
#  322|   	char *base_path = g_build_filename(opt_socket_path, opt_cuuid, NULL);

Scan Properties

analyzer-version-clippy1.97.1
analyzer-version-cppcheck2.21.1
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-129.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-nameconmon-2.2.1-2.fc45
store-results-to/tmp/tmpl14dwkab/conmon-2.2.1-2.fc45.tar.xz
time-created2026-08-03 13:38:22
time-finished2026-08-03 13:39:31
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpl14dwkab/conmon-2.2.1-2.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpl14dwkab/conmon-2.2.1-2.fc45.src.rpm'
tool-versioncsmock-3.8.7.HEAD-1.el9