Error: GCC_ANALYZER_WARNING (CWE-415): [#def1] ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:3366:17: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*cmd.query_cmd’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4682:28: enter_function: entry to ‘cxl_cmd_new_set_alert_config’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4684:16: call_function: calling ‘cxl_cmd_new_generic’ from ‘cxl_cmd_new_set_alert_config’ # 3364| return; # 3365| if (--cmd->refcount == 0) { # 3366|-> free(cmd->query_cmd); # 3367| free(cmd->send_cmd); # 3368| free(cmd->input_payload); Error: GCC_ANALYZER_WARNING (CWE-401): [#def2] ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:3367:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4505:28: enter_function: entry to ‘cxl_cmd_new_write_label’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4513:15: call_function: calling ‘cxl_cmd_new_generic’ from ‘cxl_cmd_new_write_label’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4513:15: return_function: returning to ‘cxl_cmd_new_write_label’ from ‘cxl_cmd_new_generic’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4514:12: branch_false: following ‘false’ branch... ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4518:51: branch_false: ...to here ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4518:14: call_function: calling ‘cxl_cmd_set_input_payload’ from ‘cxl_cmd_new_write_label’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4518:14: return_function: returning to ‘cxl_cmd_new_write_label’ from ‘cxl_cmd_set_input_payload’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4519:12: branch_true: following ‘true’ branch... ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4520:17: branch_true: ...to here ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4520:17: branch_false: following ‘false’ branch... ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4522:17: branch_false: ...to here ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4531:9: call_function: calling ‘cxl_cmd_unref’ from ‘cxl_cmd_new_write_label’ # 3365| if (--cmd->refcount == 0) { # 3366| free(cmd->query_cmd); # 3367|-> free(cmd->send_cmd); # 3368| free(cmd->input_payload); # 3369| free(cmd->output_payload); Error: GCC_ANALYZER_WARNING (CWE-401): [#def3] ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:3566:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4505:28: enter_function: entry to ‘cxl_cmd_new_write_label’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4513:15: call_function: calling ‘cxl_cmd_new_generic’ from ‘cxl_cmd_new_write_label’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4513:15: return_function: returning to ‘cxl_cmd_new_write_label’ from ‘cxl_cmd_new_generic’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4514:12: branch_false: following ‘false’ branch... ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4518:51: branch_false: ...to here ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4518:14: call_function: calling ‘cxl_cmd_set_input_payload’ from ‘cxl_cmd_new_write_label’ # 3564| if (!cmd->input_payload) # 3565| return -ENOMEM; # 3566|-> cmd->send_cmd->in.payload = (u64)cmd->input_payload; # 3567| } else { # 3568| /* Error: GCC_ANALYZER_WARNING (CWE-476): [#def4] ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4262:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘get_lsa’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4541:12: enter_function: entry to ‘__lsa_op’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4553:23: call_function: calling ‘cxl_cmd_new_read_label’ from ‘__lsa_op’ # 4260| # 4261| get_lsa = (struct cxl_cmd_get_lsa_in *)cmd->send_cmd->in.payload; # 4262|-> get_lsa->offset = cpu_to_le32(offset); # 4263| get_lsa->length = cpu_to_le32(length); # 4264| return cmd; Error: GCC_ANALYZER_WARNING (CWE-476): [#def5] ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4368:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4359:28: enter_function: entry to ‘cxl_cmd_new_set_partition’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4365:15: call_function: calling ‘cxl_cmd_new_generic’ from ‘cxl_cmd_new_set_partition’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4365:15: return_function: returning to ‘cxl_cmd_new_set_partition’ from ‘cxl_cmd_new_generic’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4368:9: danger: dereference of NULL ‘cxl_cmd_new_generic(memdev, 9)’ # 4366| CXL_MEM_COMMAND_ID_SET_PARTITION_INFO); # 4367| # 4368|-> setpart = cmd->input_payload; # 4369| setpart->volatile_size = cpu_to_le64(volatile_size) # 4370| / CXL_CAPACITY_MULTIPLIER; Error: GCC_ANALYZER_WARNING (CWE-476): [#def6] ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4369:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘setpart’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4359:28: enter_function: entry to ‘cxl_cmd_new_set_partition’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4365:15: call_function: calling ‘cxl_cmd_new_generic’ from ‘cxl_cmd_new_set_partition’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4365:15: return_function: returning to ‘cxl_cmd_new_set_partition’ from ‘cxl_cmd_new_generic’ ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4368:9: release_memory: ‘setpart’ is NULL ndctl-81/redhat-linux-build/../cxl/lib/libcxl.c:4369:9: danger: dereference of NULL ‘setpart’ # 4367| # 4368| setpart = cmd->input_payload; # 4369|-> setpart->volatile_size = cpu_to_le64(volatile_size) # 4370| / CXL_CAPACITY_MULTIPLIER; # 4371| return cmd; Error: GCC_ANALYZER_WARNING (CWE-775): [#def7] ndctl-81/redhat-linux-build/../cxl/memdev.c:1005:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘actx.f_in’ ndctl-81/redhat-linux-build/../cxl/memdev.c:1189:5: enter_function: entry to ‘cmd_free_dpa’ ndctl-81/redhat-linux-build/../cxl/memdev.c:1191:21: call_function: calling ‘memdev_action’ from ‘cmd_free_dpa’ # 1003| if (err == argc) { # 1004| usage_with_options(u, options); # 1005|-> return -EINVAL; # 1006| } # 1007| Error: GCC_ANALYZER_WARNING (CWE-775): [#def8] ndctl-81/redhat-linux-build/../cxl/memdev.c:1005:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘actx.f_out’ ndctl-81/redhat-linux-build/../cxl/memdev.c:1189:5: enter_function: entry to ‘cmd_free_dpa’ ndctl-81/redhat-linux-build/../cxl/memdev.c:1191:21: call_function: calling ‘memdev_action’ from ‘cmd_free_dpa’ # 1003| if (err == argc) { # 1004| usage_with_options(u, options); # 1005|-> return -EINVAL; # 1006| } # 1007| Error: GCC_ANALYZER_WARNING (CWE-401): [#def9] ndctl-81/redhat-linux-build/../cxl/memdev.c:1005:24: warning[-Wanalyzer-malloc-leak]: leak of ‘actx.f_in’ ndctl-81/redhat-linux-build/../cxl/memdev.c:1189:5: enter_function: entry to ‘cmd_free_dpa’ ndctl-81/redhat-linux-build/../cxl/memdev.c:1191:21: call_function: calling ‘memdev_action’ from ‘cmd_free_dpa’ # 1003| if (err == argc) { # 1004| usage_with_options(u, options); # 1005|-> return -EINVAL; # 1006| } # 1007| Error: GCC_ANALYZER_WARNING (CWE-401): [#def10] ndctl-81/redhat-linux-build/../cxl/memdev.c:1005:24: warning[-Wanalyzer-malloc-leak]: leak of ‘actx.f_out’ ndctl-81/redhat-linux-build/../cxl/memdev.c:1189:5: enter_function: entry to ‘cmd_free_dpa’ ndctl-81/redhat-linux-build/../cxl/memdev.c:1191:21: call_function: calling ‘memdev_action’ from ‘cmd_free_dpa’ # 1003| if (err == argc) { # 1004| usage_with_options(u, options); # 1005|-> return -EINVAL; # 1006| } # 1007| Error: GCC_ANALYZER_WARNING (CWE-401): [#def11] ndctl-81/redhat-linux-build/../daxctl/acpi.c:159:40: warning[-Wanalyzer-malloc-leak]: leak of ‘ent’ ndctl-81/redhat-linux-build/../daxctl/acpi.c:611:12: enter_function: entry to ‘split_nfit’ ndctl-81/redhat-linux-build/../daxctl/acpi.c:615:39: call_function: calling ‘read_nfit’ from ‘split_nfit’ # 157| buf = nfit + 1; # 158| while (length) { # 159|-> struct nfit_ent *ent = calloc(1, sizeof(*ent)); # 160| # 161| if (!ent) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def12] ndctl-81/redhat-linux-build/../daxctl/acpi.c:218:40: warning[-Wanalyzer-malloc-leak]: leak of ‘ent’ ndctl-81/redhat-linux-build/../daxctl/acpi.c:754:12: enter_function: entry to ‘do_split’ ndctl-81/redhat-linux-build/../daxctl/acpi.c:757:18: call_function: calling ‘split_srat’ from ‘do_split’ # 216| buf = srat + 1; # 217| while (length) { # 218|-> struct srat_ent *ent = calloc(1, sizeof(*ent)); # 219| # 220| if (!ent) { Error: GCC_ANALYZER_WARNING (CWE-775): [#def13] ndctl-81/redhat-linux-build/../ndctl/dimm.c:1328:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘actx.f_in’ ndctl-81/redhat-linux-build/../ndctl/dimm.c:1629:5: enter_function: entry to ‘cmd_wait_overwrite’ ndctl-81/redhat-linux-build/../ndctl/dimm.c:1631:21: call_function: calling ‘dimm_action’ from ‘cmd_wait_overwrite’ # 1326| if (err == argc) { # 1327| usage_with_options(u, options); # 1328|-> return -EINVAL; # 1329| } # 1330| Error: GCC_ANALYZER_WARNING (CWE-775): [#def14] ndctl-81/redhat-linux-build/../ndctl/dimm.c:1328:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘actx.f_out’ ndctl-81/redhat-linux-build/../ndctl/dimm.c:1629:5: enter_function: entry to ‘cmd_wait_overwrite’ ndctl-81/redhat-linux-build/../ndctl/dimm.c:1631:21: call_function: calling ‘dimm_action’ from ‘cmd_wait_overwrite’ # 1326| if (err == argc) { # 1327| usage_with_options(u, options); # 1328|-> return -EINVAL; # 1329| } # 1330| Error: GCC_ANALYZER_WARNING (CWE-401): [#def15] ndctl-81/redhat-linux-build/../ndctl/dimm.c:1328:24: warning[-Wanalyzer-malloc-leak]: leak of ‘actx.f_in’ ndctl-81/redhat-linux-build/../ndctl/dimm.c:1629:5: enter_function: entry to ‘cmd_wait_overwrite’ ndctl-81/redhat-linux-build/../ndctl/dimm.c:1631:21: call_function: calling ‘dimm_action’ from ‘cmd_wait_overwrite’ # 1326| if (err == argc) { # 1327| usage_with_options(u, options); # 1328|-> return -EINVAL; # 1329| } # 1330| Error: GCC_ANALYZER_WARNING (CWE-401): [#def16] ndctl-81/redhat-linux-build/../ndctl/dimm.c:1328:24: warning[-Wanalyzer-malloc-leak]: leak of ‘actx.f_out’ ndctl-81/redhat-linux-build/../ndctl/dimm.c:1629:5: enter_function: entry to ‘cmd_wait_overwrite’ ndctl-81/redhat-linux-build/../ndctl/dimm.c:1631:21: call_function: calling ‘dimm_action’ from ‘cmd_wait_overwrite’ # 1326| if (err == argc) { # 1327| usage_with_options(u, options); # 1328|-> return -EINVAL; # 1329| } # 1330| Error: GCC_ANALYZER_WARNING (CWE-476): [#def17] ndctl-81/redhat-linux-build/../ndctl/lib/libndctl.c:5634:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dax’ ndctl-81/redhat-linux-build/../ndctl/lib/libndctl.c:5627:33: acquire_memory: this call could return NULL ndctl-81/redhat-linux-build/../ndctl/lib/libndctl.c:5631:12: branch_false: following ‘false’ branch (when ‘dax’ is non-NULL)... ndctl-81/redhat-linux-build/../ndctl/lib/libndctl.c:5634:9: branch_false: ...to here ndctl-81/redhat-linux-build/../ndctl/lib/libndctl.c:5634:9: danger: ‘dax’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 5632| return NULL; # 5633| # 5634|-> pfn->id = id; # 5635| pfn->region = region; # 5636| if (!__add_pfn(pfn, dax_base)) { Error: GCC_ANALYZER_WARNING (CWE-688): [#def18] ndctl-81/redhat-linux-build/../ndctl/load-keys.c:187:14: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘keypath’ where non-null expected ndctl-81/redhat-linux-build/../ndctl/load-keys.c:232:5: enter_function: entry to ‘cmd_load_keys’ ndctl-81/redhat-linux-build/../ndctl/load-keys.c:250:12: branch_false: following ‘false’ branch... ndctl-81/redhat-linux-build/../ndctl/load-keys.c:253:14: branch_false: ...to here ndctl-81/redhat-linux-build/../ndctl/load-keys.c:253:12: branch_true: following ‘true’ branch... ndctl-81/redhat-linux-build/../ndctl/load-keys.c:254:34: branch_true: ...to here ndctl-81/redhat-linux-build/../ndctl/load-keys.c:254:34: acquire_memory: this call could return NULL ndctl-81/redhat-linux-build/../ndctl/load-keys.c:256:16: call_function: calling ‘load_keys’ from ‘cmd_load_keys’ # 185| int rc; # 186| # 187|-> rc = chdir(keypath); # 188| if (rc < 0) { # 189| fprintf(stderr, "Change current work dir to %s failed: %s\n", Error: COMPILER_WARNING: [#def19] ndctl-81/redhat-linux-build/../util/parse-configs.c:7:10: warning[fatal error]: iniparser.h: No such file or directory # 5| #include <errno.h> # 6| #include <fcntl.h> # 7|-> #include <iniparser.h> # 8| #include <sys/stat.h> # 9| #include <util/parse-configs.h> Error: GCC_ANALYZER_WARNING (CWE-688): [#def20] ndctl-81/redhat-linux-build/../util/parse-options.c:151:38: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected ndctl-81/redhat-linux-build/../util/parse-options.c:530:5: enter_function: entry to ‘parse_options’ ndctl-81/redhat-linux-build/../util/parse-options.c:533:16: call_function: calling ‘parse_options_subcommand_prefix’ from ‘parse_options’ # 149| if (get_arg(p, opt, flags, &arg)) # 150| return -1; # 151|-> *(int *)opt->value = strtol(arg, (char **)&s, 10); # 152| if (*s) # 153| return opterror(opt, "expects a numerical value", flags); Error: GCC_ANALYZER_WARNING (CWE-688): [#def21] ndctl-81/redhat-linux-build/../util/parse-options.c:167:47: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected ndctl-81/redhat-linux-build/../util/parse-options.c:530:5: enter_function: entry to ‘parse_options’ ndctl-81/redhat-linux-build/../util/parse-options.c:533:16: call_function: calling ‘parse_options_subcommand_prefix’ from ‘parse_options’ # 165| if (get_arg(p, opt, flags, &arg)) # 166| return -1; # 167|-> *(unsigned int *)opt->value = strtol(arg, (char **)&s, 10); # 168| if (*s) # 169| return opterror(opt, "expects a numerical value", flags); Error: GCC_ANALYZER_WARNING (CWE-688): [#def22] ndctl-81/redhat-linux-build/../util/parse-options.c:183:39: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected ndctl-81/redhat-linux-build/../util/parse-options.c:530:5: enter_function: entry to ‘parse_options’ ndctl-81/redhat-linux-build/../util/parse-options.c:533:16: call_function: calling ‘parse_options_subcommand_prefix’ from ‘parse_options’ # 181| if (get_arg(p, opt, flags, &arg)) # 182| return -1; # 183|-> *(long *)opt->value = strtol(arg, (char **)&s, 10); # 184| if (*s) # 185| return opterror(opt, "expects a numerical value", flags); Error: GCC_ANALYZER_WARNING (CWE-688): [#def23] ndctl-81/redhat-linux-build/../util/parse-options.c:199:43: warning[-Wanalyzer-null-argument]: use of NULL ‘arg’ where non-null expected ndctl-81/redhat-linux-build/../util/parse-options.c:530:5: enter_function: entry to ‘parse_options’ ndctl-81/redhat-linux-build/../util/parse-options.c:533:16: call_function: calling ‘parse_options_subcommand_prefix’ from ‘parse_options’ # 197| if (get_arg(p, opt, flags, &arg)) # 198| return -1; # 199|-> *(uint64_t *)opt->value = strtoull(arg, (char **)&s, 10); # 200| if (*s) # 201| return opterror(opt, "expects a numerical value", flags);
analyzer-version-clippy | 1.86.0 |
analyzer-version-cppcheck | 2.17.1 |
analyzer-version-gcc | 15.0.1 |
analyzer-version-gcc-analyzer | 15.0.1 |
analyzer-version-shellcheck | 0.10.0 |
analyzer-version-unicontrol | 0.0.2 |
enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
exit-code | 0 |
host | ip-172-16-1-91.us-west-2.compute.internal |
known-false-positives | /usr/share/csmock/known-false-positives.js |
known-false-positives-rpm | known-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch |
mock-config | fedora-rawhide-x86_64 |
project-name | ndctl-81-1.fc43 |
store-results-to | /tmp/tmpfsokozi9/ndctl-81-1.fc43.tar.xz |
time-created | 2025-04-25 14:35:53 |
time-finished | 2025-04-25 14:37:33 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpfsokozi9/ndctl-81-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpfsokozi9/ndctl-81-1.fc43.src.rpm' |
tool-version | csmock-3.8.1.20250422.172604.g26bc3d6-1.el9 |