Task #78369 - added.err
back to task #78369download
Error: GCC_ANALYZER_WARNING (CWE-775):
rdma-core-59.0/librdmacm/examples/common.c:269:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘accept(listen_sock, 0, 0)’
rdma-core-59.0/librdmacm/examples/common.c:252:5: enter_function: entry to ‘oob_root_setup’
rdma-core-59.0/librdmacm/examples/common.c:257:15: call_function: calling ‘oob_init_root’ from ‘oob_root_setup’
rdma-core-59.0/librdmacm/examples/common.c:257:15: return_function: returning to ‘oob_root_setup’ from ‘oob_init_root’
rdma-core-59.0/librdmacm/examples/common.c:258:12: branch_false: following ‘false’ branch...
rdma-core-59.0/librdmacm/examples/common.c:261:15: branch_false: ...to here
rdma-core-59.0/librdmacm/examples/common.c:262:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
<unknown>: branch_false: ...to here
rdma-core-59.0/librdmacm/examples/common.c:267:21: branch_true: following ‘true’ branch (when ‘i < cnt’)...
rdma-core-59.0/librdmacm/examples/common.c:268:17: branch_true: ...to here
rdma-core-59.0/librdmacm/examples/common.c:269:20: branch_false: following ‘false’ branch...
rdma-core-59.0/librdmacm/examples/common.c:273:17: branch_false: ...to here
rdma-core-59.0/librdmacm/examples/common.c:267:21: branch_true: following ‘true’ branch (when ‘i < cnt’)...
rdma-core-59.0/librdmacm/examples/common.c:268:17: branch_true: ...to here
rdma-core-59.0/librdmacm/examples/common.c:269:21: danger: ‘accept(listen_sock, 0, 0)’ leaks here
# 267| for (i = 0; i < cnt; i++) {
# 268| root->sock[i] = accept(listen_sock, NULL, NULL);
# 269|-> if (root->sock[i] == -1) {
# 270| ret = -errno;
# 271| break;
Error: GCC_ANALYZER_WARNING (CWE-401):
rdma-core-59.0/providers/efa/verbs.c:275:16: warning[-Wanalyzer-malloc-leak]: leak of ‘parent_domain’
rdma-core-59.0/providers/efa/verbs.c:228:16: enter_function: entry to ‘efa_alloc_parent_domain’
rdma-core-59.0/providers/efa/verbs.c:234:13: call_function: inlined call to ‘ibv_check_alloc_parent_domain’ from ‘efa_alloc_parent_domain’
rdma-core-59.0/providers/efa/verbs.c:239:30: branch_false: ...to here
rdma-core-59.0/providers/efa/verbs.c:239:12: branch_false: following ‘false’ branch...
rdma-core-59.0/providers/efa/verbs.c:249:13: branch_false: ...to here
rdma-core-59.0/providers/efa/verbs.c:249:12: branch_false: following ‘false’ branch...
rdma-core-59.0/providers/efa/verbs.c:254:25: branch_false: ...to here
rdma-core-59.0/providers/efa/verbs.c:254:25: acquire_memory: allocated here
rdma-core-59.0/providers/efa/verbs.c:255:12: branch_false: following ‘false’ branch (when ‘parent_domain’ is non-NULL)...
rdma-core-59.0/providers/efa/verbs.c:260:9: branch_false: ...to here
rdma-core-59.0/providers/efa/verbs.c:262:12: branch_false: following ‘false’ branch...
rdma-core-59.0/providers/efa/verbs.c:267:9: branch_false: ...to here
rdma-core-59.0/providers/efa/verbs.c:272:12: branch_false: following ‘false’ branch...
rdma-core-59.0/providers/efa/verbs.c:275:16: branch_false: ...to here
rdma-core-59.0/providers/efa/verbs.c:275:16: danger: ‘parent_domain’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
# 273| parent_domain->pd_context = attr->pd_context;
# 274|
# 275|-> return &parent_domain->pd.ibvpd;
# 276| }
# 277|
Error: GCC_ANALYZER_WARNING (CWE-401):
rdma-core-59.0/providers/efa/verbs.c:1048:15: warning[-Wanalyzer-malloc-leak]: leak of ‘cq’
rdma-core-59.0/providers/efa/verbs.c:1000:12: branch_false: following ‘false’ branch...
rdma-core-59.0/providers/efa/verbs.c:1001:14: branch_false: ...to here
rdma-core-59.0/providers/efa/verbs.c:1000:13: branch_false: following ‘false’ branch...
rdma-core-59.0/providers/efa/verbs.c:1008:13: branch_false: ...to here
rdma-core-59.0/providers/efa/verbs.c:1014:12: branch_false: following ‘false’ branch...
rdma-core-59.0/providers/efa/verbs.c:1026:50: branch_false: ...to here
rdma-core-59.0/providers/efa/verbs.c:1025:14: acquire_memory: allocated here
rdma-core-59.0/providers/efa/verbs.c:1027:12: branch_false: following ‘false’ branch (when ‘cq’ is non-NULL)...
rdma-core-59.0/providers/efa/verbs.c:1030:13: branch_false: ...to here
rdma-core-59.0/providers/efa/verbs.c:1037:12: branch_false: following ‘false’ branch...
rdma-core-59.0/providers/efa/verbs.c:1044:12: branch_false: ...to here
rdma-core-59.0/providers/efa/verbs.c:1044:12: branch_false: following ‘false’ branch...
rdma-core-59.0/providers/efa/verbs.c:1047:40: branch_false: ...to here
rdma-core-59.0/providers/efa/verbs.c:1048:15: danger: ‘cq’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
# 1046|
# 1047| attr->cqe = roundup_pow_of_two(attr->cqe);
# 1048|-> err = ibv_cmd_create_cq_ex(ibvctx, attr, &prov_attr, &cq->verbs_cq,
# 1049| &cmd.ibv_cmd, sizeof(cmd),
# 1050| &resp.ibv_resp, sizeof(resp), cmd_flags);
Error: GCC_ANALYZER_WARNING (CWE-401):
rdma-core-59.0/providers/efa/verbs.c:2811:16: warning[-Wanalyzer-malloc-leak]: leak of ‘td’
rdma-core-59.0/providers/efa/verbs.c:2796:12: branch_false: following ‘false’ branch...
rdma-core-59.0/providers/efa/verbs.c:2802:14: branch_false: ...to here
rdma-core-59.0/providers/efa/verbs.c:2802:14: acquire_memory: allocated here
rdma-core-59.0/providers/efa/verbs.c:2803:12: branch_false: following ‘false’ branch (when ‘td’ is non-NULL)...
rdma-core-59.0/providers/efa/verbs.c:2808:9: branch_false: ...to here
rdma-core-59.0/providers/efa/verbs.c:2811:16: danger: ‘td’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
# 2809| atomic_init(&td->refcount, 0);
# 2810|
# 2811|-> return &td->ibvtd;
# 2812| }
# 2813|
Error: GCC_ANALYZER_WARNING (CWE-401):
rdma-core-59.0/providers/mlx5/verbs.c:3048:15: warning[-Wanalyzer-malloc-leak]: leak of ‘dmah’
rdma-core-59.0/providers/mlx5/verbs.c:3022:12: branch_false: following ‘false’ branch...
rdma-core-59.0/providers/mlx5/verbs.c:3028:14: branch_false: ...to here
rdma-core-59.0/providers/mlx5/verbs.c:3028:12: branch_false: following ‘false’ branch...
rdma-core-59.0/providers/mlx5/verbs.c:3035:13: branch_false: ...to here
rdma-core-59.0/providers/mlx5/verbs.c:3042:16: acquire_memory: allocated here
rdma-core-59.0/providers/mlx5/verbs.c:3043:12: branch_false: following ‘false’ branch (when ‘dmah’ is non-NULL)...
rdma-core-59.0/providers/mlx5/verbs.c:3048:15: branch_false: ...to here
rdma-core-59.0/providers/mlx5/verbs.c:3048:15: danger: ‘dmah’ leaks here; was allocated at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
# 3046| }
# 3047|
# 3048|-> ret = ibv_cmd_alloc_dmah(context, dmah, attr);
# 3049| if (ret)
# 3050| goto err;
Error: GCC_ANALYZER_WARNING (CWE-401):
rdma-core-59.0/providers/rxe/rxe.c:432:15: warning[-Wanalyzer-malloc-leak]: leak of ‘cq’
rdma-core-59.0/providers/rxe/rxe.c:423:12: branch_false: following ‘false’ branch...
rdma-core-59.0/providers/rxe/rxe.c:428:14: branch_false: ...to here
rdma-core-59.0/providers/rxe/rxe.c:428:14: acquire_memory: allocated here
rdma-core-59.0/providers/rxe/rxe.c:429:12: branch_false: following ‘false’ branch (when ‘cq’ is non-NULL)...
rdma-core-59.0/providers/rxe/rxe.c:432:15: branch_false: ...to here
rdma-core-59.0/providers/rxe/rxe.c:432:15: danger: ‘cq’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
# 430| goto err;
# 431|
# 432|-> ret = ibv_cmd_create_cq_ex(context, attr, NULL,
# 433| &cq->vcq, NULL, 0,
# 434| &resp.ibv_resp, sizeof(resp), 0);
Error: GCC_ANALYZER_WARNING (CWE-775):
rdma-core-59.0/srp_daemon/srp_daemon.c:168:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
rdma-core-59.0/srp_daemon/srp_daemon.c:1903:12: enter_function: entry to ‘check_link_layer’
rdma-core-59.0/srp_daemon/srp_daemon.c:1909:15: call_function: calling ‘srpd_sys_read_string’ from ‘check_link_layer’
# 166| int e = errno;
# 167| close(fd);
# 168|-> return (e > 0) ? -e : e;
# 169| }
# 170|
Error: GCC_ANALYZER_WARNING (CWE-775):
rdma-core-59.0/srp_daemon/srp_daemon.c:176:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&path, 0)’
rdma-core-59.0/srp_daemon/srp_daemon.c:1903:12: enter_function: entry to ‘check_link_layer’
rdma-core-59.0/srp_daemon/srp_daemon.c:1909:15: call_function: calling ‘srpd_sys_read_string’ from ‘check_link_layer’
# 174| *s = 0;
# 175|
# 176|-> close(fd);
# 177| return 0;
# 178| }
Error: GCC_ANALYZER_WARNING (CWE-775):
rdma-core-59.0/srp_daemon/srp_daemon.c:302:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*conf.rules_file, "r")’
rdma-core-59.0/srp_daemon/srp_daemon.c:2210:5: enter_function: entry to ‘main’
rdma-core-59.0/srp_daemon/srp_daemon.c:2243:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
rdma-core-59.0/srp_daemon/srp_daemon.c:2249:19: branch_false: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:2257:12: branch_false: following ‘false’ branch...
rdma-core-59.0/srp_daemon/srp_daemon.c:2263:13: branch_false: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:2263:13: call_function: calling ‘get_config’ from ‘main’
# 300| switch (s_log_dest) {
# 301| case log_to_syslog:
# 302|-> vsyslog(LOG_DAEMON | LOG_ERR, fmt, args);
# 303| break;
# 304| case log_to_stderr:
Error: GCC_ANALYZER_WARNING (CWE-401):
rdma-core-59.0/srp_daemon/srp_daemon.c:302:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*conf.rules_file, "r")’
rdma-core-59.0/srp_daemon/srp_daemon.c:2210:5: enter_function: entry to ‘main’
rdma-core-59.0/srp_daemon/srp_daemon.c:2243:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
rdma-core-59.0/srp_daemon/srp_daemon.c:2249:19: branch_false: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:2257:12: branch_false: following ‘false’ branch...
rdma-core-59.0/srp_daemon/srp_daemon.c:2263:13: branch_false: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:2263:13: call_function: calling ‘get_config’ from ‘main’
# 300| switch (s_log_dest) {
# 301| case log_to_syslog:
# 302|-> vsyslog(LOG_DAEMON | LOG_ERR, fmt, args);
# 303| break;
# 304| case log_to_stderr:
Error: GCC_ANALYZER_WARNING (CWE-404):
rdma-core-59.0/srp_daemon/srp_daemon.c:302:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
rdma-core-59.0/srp_daemon/srp_daemon.c:2119:12: enter_function: entry to ‘setup_wakeup_fd’
rdma-core-59.0/srp_daemon/srp_daemon.c:2125:12: branch_true: following ‘true’ branch (when ‘ret < 0’)...
rdma-core-59.0/srp_daemon/srp_daemon.c:2126:17: branch_true: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:2126:17: call_function: calling ‘pr_err’ from ‘setup_wakeup_fd’
# 300| switch (s_log_dest) {
# 301| case log_to_syslog:
# 302|-> vsyslog(LOG_DAEMON | LOG_ERR, fmt, args);
# 303| break;
# 304| case log_to_stderr:
Error: GCC_ANALYZER_WARNING (CWE-775):
rdma-core-59.0/srp_daemon/srp_daemon.c:414:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/sys/module/ib_srp/parameters/use_imm_data", 0)’
rdma-core-59.0/srp_daemon/srp_daemon.c:1959:14: enter_function: entry to ‘run_thread_retry_to_connect’
rdma-core-59.0/srp_daemon/srp_daemon.c:1966:16: branch_true: following ‘true’ branch...
rdma-core-59.0/srp_daemon/srp_daemon.c:1967:21: branch_true: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:1970:24: branch_true: following ‘true’ branch...
rdma-core-59.0/srp_daemon/srp_daemon.c:1971:34: branch_true: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:1970:24: branch_true: following ‘true’ branch...
rdma-core-59.0/srp_daemon/srp_daemon.c:1972:47: branch_true: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:1978:25: call_function: calling ‘add_non_exist_target’ from ‘run_thread_retry_to_connect’
# 412| cnt = read(fd, &flag, 1);
# 413| if (cnt != 1) {
# 414|-> close(fd);
# 415| return false;
# 416| }
Error: GCC_ANALYZER_WARNING (CWE-775):
rdma-core-59.0/srp_daemon/srp_daemon.c:420:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/sys/module/ib_srp/parameters/use_imm_data", 0)’
rdma-core-59.0/srp_daemon/srp_daemon.c:1959:14: enter_function: entry to ‘run_thread_retry_to_connect’
rdma-core-59.0/srp_daemon/srp_daemon.c:1966:16: branch_true: following ‘true’ branch...
rdma-core-59.0/srp_daemon/srp_daemon.c:1967:21: branch_true: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:1970:24: branch_true: following ‘true’ branch...
rdma-core-59.0/srp_daemon/srp_daemon.c:1971:34: branch_true: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:1970:24: branch_true: following ‘true’ branch...
rdma-core-59.0/srp_daemon/srp_daemon.c:1972:47: branch_true: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:1978:25: call_function: calling ‘add_non_exist_target’ from ‘run_thread_retry_to_connect’
# 418| if (!strncmp(&flag, "Y", 1))
# 419| ret = true;
# 420|-> close(fd);
# 421| return ret;
# 422| }
Error: GCC_ANALYZER_WARNING (CWE-401):
rdma-core-59.0/srp_daemon/srp_daemon.c:473:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&scsi_host_dir)’
rdma-core-59.0/srp_daemon/srp_daemon.c:1959:14: enter_function: entry to ‘run_thread_retry_to_connect’
rdma-core-59.0/srp_daemon/srp_daemon.c:1966:16: branch_true: following ‘true’ branch...
rdma-core-59.0/srp_daemon/srp_daemon.c:1967:21: branch_true: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:1970:24: branch_true: following ‘true’ branch...
rdma-core-59.0/srp_daemon/srp_daemon.c:1971:34: branch_true: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:1970:24: branch_true: following ‘true’ branch...
rdma-core-59.0/srp_daemon/srp_daemon.c:1972:47: branch_true: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:1978:25: call_function: calling ‘add_non_exist_target’ from ‘run_thread_retry_to_connect’
# 471| subdir = (void *) 1; /* Dummy value to enter the loop */
# 472| while (subdir) {
# 473|-> subdir = readdir(dir);
# 474|
# 475| if (!subdir)
Error: GCC_ANALYZER_WARNING (CWE-688):
rdma-core-59.0/srp_daemon/srp_daemon.c:727:23: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘dup’ where non-null expected
rdma-core-59.0/srp_daemon/srp_daemon.c:1716:12: enter_function: entry to ‘get_config’
rdma-core-59.0/srp_daemon/srp_daemon.c:1851:9: call_function: calling ‘initialize_sysfs’ from ‘get_config’
#argument 1 of ‘__builtin_strlen’ must be non-null
# 725|
# 726| sysfs_path = dup = strndup(env, 256);
# 727|-> len = strlen(dup);
# 728| while (len > 0 && dup[len - 1] == '/') {
# 729| --len;
Error: GCC_ANALYZER_WARNING (CWE-775):
rdma-core-59.0/srp_daemon/srp_daemon.c:1561:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*conf.rules_file, "r")’
rdma-core-59.0/srp_daemon/srp_daemon.c:2210:5: enter_function: entry to ‘main’
rdma-core-59.0/srp_daemon/srp_daemon.c:2243:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
rdma-core-59.0/srp_daemon/srp_daemon.c:2249:19: branch_false: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:2257:12: branch_false: following ‘false’ branch...
rdma-core-59.0/srp_daemon/srp_daemon.c:2263:13: branch_false: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:2263:13: call_function: calling ‘get_config’ from ‘main’
# 1559| }
# 1560|
# 1561|-> if (fseek(infile, 0L, SEEK_SET) != 0) {
# 1562| pr_err("internal error while seeking %s\n", conf->rules_file);
# 1563| goto out;
Error: GCC_ANALYZER_WARNING (CWE-401):
rdma-core-59.0/srp_daemon/srp_daemon.c:1561:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*conf.rules_file, "r")’
rdma-core-59.0/srp_daemon/srp_daemon.c:2210:5: enter_function: entry to ‘main’
rdma-core-59.0/srp_daemon/srp_daemon.c:2243:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
rdma-core-59.0/srp_daemon/srp_daemon.c:2249:19: branch_false: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:2257:12: branch_false: following ‘false’ branch...
rdma-core-59.0/srp_daemon/srp_daemon.c:2263:13: branch_false: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:2263:13: call_function: calling ‘get_config’ from ‘main’
# 1559| }
# 1560|
# 1561|-> if (fseek(infile, 0L, SEEK_SET) != 0) {
# 1562| pr_err("internal error while seeking %s\n", conf->rules_file);
# 1563| goto out;
Error: GCC_ANALYZER_WARNING (CWE-476):
rdma-core-59.0/srp_daemon/srp_daemon.c:1579:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rule’
rdma-core-59.0/srp_daemon/srp_daemon.c:2210:5: enter_function: entry to ‘main’
rdma-core-59.0/srp_daemon/srp_daemon.c:2243:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
rdma-core-59.0/srp_daemon/srp_daemon.c:2249:19: branch_false: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:2257:12: branch_false: following ‘false’ branch...
rdma-core-59.0/srp_daemon/srp_daemon.c:2263:13: branch_false: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:2263:13: call_function: calling ‘get_config’ from ‘main’
# 1577| case 'a':
# 1578| case 'A':
# 1579|-> rule->allow = 1;
# 1580| break;
# 1581| case 'd':
Error: GCC_ANALYZER_WARNING (CWE-476):
rdma-core-59.0/srp_daemon/srp_daemon.c:1583:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rule’
rdma-core-59.0/srp_daemon/srp_daemon.c:2210:5: enter_function: entry to ‘main’
rdma-core-59.0/srp_daemon/srp_daemon.c:2243:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
rdma-core-59.0/srp_daemon/srp_daemon.c:2249:19: branch_false: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:2257:12: branch_false: following ‘false’ branch...
rdma-core-59.0/srp_daemon/srp_daemon.c:2263:13: branch_false: ...to here
rdma-core-59.0/srp_daemon/srp_daemon.c:2263:13: call_function: calling ‘get_config’ from ‘main’
# 1581| case 'd':
# 1582| case 'D':
# 1583|-> rule->allow = 0;
# 1584| break;
# 1585| default:
Error: GCC_ANALYZER_WARNING (CWE-476):
rdma-core-59.0/srp_daemon/srp_daemon.c:2147:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘config’
rdma-core-59.0/srp_daemon/srp_daemon.c:2146:18: acquire_memory: this call could return NULL
rdma-core-59.0/srp_daemon/srp_daemon.c:2147:9: danger: ‘calloc(1, 96)’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
# 2145|
# 2146| config = calloc(1, sizeof(*config));
# 2147|-> config->num_of_oust = 10;
# 2148| config->timeout = 5000;
# 2149| config->mad_retries = 3;