Newly introduced findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1]
crun-HEAD/src/libcrun/cgroup-resources.c:153:12: warning[-Wanalyzer-null-argument]: use of NULL 'controllers' where non-null expected
<built-in>: note: argument 1 of '__builtin_strchr' must be non-null
#  151|         key = xstrdup (name);
#  152|   
#  153|->       it = strchr (key, '.');
#  154|         if (it == NULL)
#  155|           {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def2]
crun-HEAD/src/libcrun/cgroup-systemd.c: scope_hint: In function 'bpfprog_path_from_scope'
crun-HEAD/src/libcrun/cgroup-systemd.c:1389:16: warning[-Wanalyzer-null-argument]: use of NULL 'it' where non-null expected
crun-HEAD/src/libcrun/cgroup-internal.h:22: included_from: Included from here.
crun-HEAD/src/libcrun/cgroup-systemd.c:23: included_from: Included from here.
<built-in>: note: argument 1 of '__builtin_strchr' must be non-null
# 1387|     /* Remove dots as EBPF code don't like them.  */
# 1388|     it = flat_scope;
# 1389|->   while ((it = strchr (it, '.')) != NULL)
# 1390|       *it = '_';
# 1391|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
crun-HEAD/src/libcrun/ebpf.c: scope_hint: In function 'libcrun_ebpf_read_program'
crun-HEAD/src/libcrun/ebpf.c:103:41: warning[-Wanalyzer-malloc-leak]: leak of 'bpf_program_new(buffer_size)'
#  101|   bpf_program_new (size_t size)
#  102|   {
#  103|->   struct bpf_program *p = xmalloc (size + sizeof (struct bpf_program));
#  104|   
#  105|     p->used = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
crun-HEAD/src/libcrun/ebpf.c:115:8: warning[-Wanalyzer-malloc-leak]: leak of 'bpf_program_append(bpf_program_new(buffer_size), xmalloc(buffer_size), buffer_size)'
#  113|   bpf_program_append (struct bpf_program *p, void *data, size_t size)
#  114|   {
#  115|->   if (p->allocated <= p->used + size)
#  116|       {
#  117|         p->allocated += size * 2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
crun-HEAD/src/libcrun/ebpf.c:23: included_from: Included from here.
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'libcrun_ebpf_read_program'
crun-HEAD/src/libcrun/utils.h:65:21: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(buffer_size)'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
crun-HEAD/src/libcrun/utils.h:57:40: note: in definition of macro 'UNLIKELY'
#   63|   {
#   64|     void *res = malloc (size);
#   65|->   if (UNLIKELY (res == NULL))
#   66|       OOM ();
#   67|     return res;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def6]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '<unknown>'
crun-HEAD/src/libcrun/ebpf.h:25: included_from: Included from here.
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
#  106|     int *pp = (int *) p;
#  107|     if (*pp >= 0)
#  108|->     TEMP_FAILURE_RETRY (close (*pp));
#  109|   }
#  110|   

Scan Properties

analyzer-version-clippy1.88.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.1.1
analyzer-version-gcc-analyzer15.1.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.88.0
diffbase-analyzer-version-cppcheck2.17.1
diffbase-analyzer-version-gcc15.1.1
diffbase-analyzer-version-gcc-analyzer15.1.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-12.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-namecrun-1.22-1.20250708092116567834.main.29.ge8b39523
diffbase-store-results-to/tmp/tmpee_dfui3/crun-1.22-1.20250708092116567834.main.29.ge8b39523.tar.xz
diffbase-time-created2025-07-09 18:05:27
diffbase-time-finished2025-07-09 18:25:20
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,shellcheck,gcc,clippy' '-o' '/tmp/tmpee_dfui3/crun-1.22-1.20250708092116567834.main.29.ge8b39523.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpee_dfui3/crun-1.22-1.20250708092116567834.main.29.ge8b39523.src.rpm'
diffbase-tool-versioncsmock-3.8.1.20250626.171830.gc374be3-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-12.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-namecrun-1.22-1.20250709175751277112.pr1795.34.gad9f90b7
store-results-to/tmp/tmpvggb6ulx/crun-1.22-1.20250709175751277112.pr1795.34.gad9f90b7.tar.xz
time-created2025-07-09 18:25:39
time-finished2025-07-09 18:48:53
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,shellcheck,gcc,clippy' '-o' '/tmp/tmpvggb6ulx/crun-1.22-1.20250709175751277112.pr1795.34.gad9f90b7.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpvggb6ulx/crun-1.22-1.20250709175751277112.pr1795.34.gad9f90b7.src.rpm'
tool-versioncsmock-3.8.1.20250626.171830.gc374be3-1.el9