Newly introduced findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1]
crun-HEAD/src/libcrun/cgroup-systemd.c: scope_hint: In function 'get_cgroup_scope_path'
crun-HEAD/src/libcrun/cgroup-systemd.c:2072:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
<built-in>: note: argument 1 of '__builtin_strchr' must be non-null
# 2070|     path_to_scope = xstrdup (cgroup_path);
# 2071|   
# 2072|->   cur = strchr (path_to_scope, '/');
# 2073|     while (cur)
# 2074|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
crun-HEAD/src/libcrun/cgroup-systemd.c: scope_hint: In function 'libcrun_destroy_cgroup_systemd'
crun-HEAD/src/libcrun/cgroup-systemd.c:2073:10: warning[-Wanalyzer-malloc-leak]: leak of 'get_cgroup_scope_path(*cgroup_status.path, *cgroup_status.scope)'
# 2071|   
# 2072|     cur = strchr (path_to_scope, '/');
# 2073|->   while (cur)
# 2074|       {
# 2075|         char *next = strchr (cur + 1, '/');

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
crun-HEAD/src/libcrun/cgroup-systemd.c:2075:32: warning[-Wanalyzer-malloc-leak]: leak of 'get_cgroup_scope_path(*cgroup_status.path, *cgroup_status.scope)'
# 2073|     while (cur)
# 2074|       {
# 2075|->       char *next = strchr (cur + 1, '/');
# 2076|         if (next == NULL)
# 2077|           break;

Error: COMPILER_WARNING (CWE-563): [#def4]
crun-HEAD/src/libcrun/ebpf.c: scope_hint: In function 'libcrun_ebpf_query_cgroup_progs'
crun-HEAD/src/libcrun/ebpf.c:620:7: warning[-Wunused-variable]: unused variable 'ret'
#  620 |   int ret;
#      |       ^~~
#  618|   #else
#  619|     cleanup_close int cgroup_fd = -1;
#  620|->   int ret;
#  621|   
#  622|     cgroup_fd = open (cgroup_path, O_RDONLY | O_CLOEXEC);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
crun-HEAD/src/libcrun/ebpf.c: scope_hint: In function 'libcrun_ebpf_query_cgroup_progs'
crun-HEAD/src/libcrun/ebpf.c:622:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(cgroup_path, 524288)'
#  620|     int ret;
#  621|   
#  622|->   cgroup_fd = open (cgroup_path, O_RDONLY | O_CLOEXEC);
#  623|     if (UNLIKELY (cgroup_fd < 0))
#  624|       return crun_make_error (err, errno, "open cgroup path `%s`", cgroup_path);

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 'cgroup_fd'
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.89.0
analyzer-version-cppcheck2.18.2
analyzer-version-gcc15.2.1
analyzer-version-gcc-analyzer15.2.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.89.0
diffbase-analyzer-version-cppcheck2.18.2
diffbase-analyzer-version-gcc15.2.1
diffbase-analyzer-version-gcc-analyzer15.2.1
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-182.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.23.1-1.20250901085205635666.main.26.gf5f267c6
diffbase-store-results-to/tmp/tmpqfvo2lg2/crun-1.23.1-1.20250901085205635666.main.26.gf5f267c6.tar.xz
diffbase-time-created2025-09-01 13:18:10
diffbase-time-finished2025-09-01 13:23:49
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,shellcheck,gcc,clippy,cppcheck' '-o' '/tmp/tmpqfvo2lg2/crun-1.23.1-1.20250901085205635666.main.26.gf5f267c6.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpqfvo2lg2/crun-1.23.1-1.20250901085205635666.main.26.gf5f267c6.src.rpm'
diffbase-tool-versioncsmock-3.8.2.20250811.215846.gf3b3dbf-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-182.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.23.1-1.20250901130803658032.pr1865.27.g50e58d10
store-results-to/tmp/tmp5zvyflci/crun-1.23.1-1.20250901130803658032.pr1865.27.g50e58d10.tar.xz
time-created2025-09-01 13:24:20
time-finished2025-09-01 13:29:24
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,shellcheck,gcc,clippy,cppcheck' '-o' '/tmp/tmp5zvyflci/crun-1.23.1-1.20250901130803658032.pr1865.27.g50e58d10.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmp5zvyflci/crun-1.23.1-1.20250901130803658032.pr1865.27.g50e58d10.src.rpm'
tool-versioncsmock-3.8.2.20250811.215846.gf3b3dbf-1.el9