Newly introduced findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'libcrun_set_sysctl'
crun-HEAD/src/libcrun/linux.c:3671:23: warning[-Wanalyzer-null-dereference]: dereference of NULL 'it'
# 3669|   
# 3670|         name = xstrdup (def->linux->sysctl->keys[i]);
# 3671|->       for (it = name; *it; it++)
# 3672|           if (*it == '.')
# 3673|             *it = '/';

Error: GCC_ANALYZER_WARNING (CWE-688): [#def2]
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'join_namespaces'
crun-HEAD/src/libcrun/linux.c:4015:17: warning[-Wanalyzer-null-argument]: use of NULL 'cwd' where non-null expected
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'join_namespaces'
/usr/include/unistd.h:517:12: note: argument 1 of 'chdir' must be non-null
# 4013|         if (value == CLONE_NEWNS)
# 4014|           {
# 4015|->           ret = chdir (cwd);
# 4016|             if (UNLIKELY (ret < 0))
# 4017|               return crun_make_error (err, errno, "chdir `%s`", cwd);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def3]
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_free_init_statusp.part.0'
crun-HEAD/src/libcrun/linux.c:4074:21: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*ns.fd_len'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_free_init_statusp.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_free_init_statusp.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_free_init_statusp.part.0'
# 4072|       return;
# 4073|   
# 4074|->   for (i = 0; i < ns->fd_len; i++)
# 4075|       TEMP_FAILURE_RETRY (close (ns->fd[i]));
# 4076|   }

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def4]
crun-HEAD/src/libcrun/linux.c:4075:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '*ns.fd[i]'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_free_init_statusp.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_free_init_statusp.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_free_init_statusp.part.0'
# 4073|   
# 4074|     for (i = 0; i < ns->fd_len; i++)
# 4075|->     TEMP_FAILURE_RETRY (close (ns->fd[i]));
# 4076|   }
# 4077|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
crun-HEAD/src/libcrun/linux.c:4075:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'init_status.fd[0]'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_free_init_statusp.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_free_init_statusp.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_free_init_statusp.part.0'
# 4073|   
# 4074|     for (i = 0; i < ns->fd_len; i++)
# 4075|->     TEMP_FAILURE_RETRY (close (ns->fd[i]));
# 4076|   }
# 4077|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def6]
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'configure_init_status'
crun-HEAD/src/libcrun/linux.c:4125:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(**_18.path, 524288)'
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'
# 4123|   
# 4124|             fd = open (def->linux->namespaces[i]->path, O_RDONLY | O_CLOEXEC);
# 4125|->           if (UNLIKELY (fd < 0))
# 4126|               return crun_make_error (err, errno, "open `%s`", def->linux->namespaces[i]->path);
# 4127|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def7]
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'is_bind_mount'
crun-HEAD/src/libcrun/linux.c:4202:19: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
# 4200|   
# 4201|     if (src_nofollow == NULL)
# 4202|->     *src_nofollow = false;
# 4203|   
# 4204|     for (i = 0; i < mnt->options_len; i++)

Error: GCC_ANALYZER_WARNING (CWE-465): [#def8]
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'precreate_device'
crun-HEAD/src/libcrun/linux.c:4407:6: warning[-Wanalyzer-deref-before-check]: check of '*def.linux' for NULL after already dereferencing it
# 4405|       return crun_make_error (err, errno, "mknod `%s`", device->path);
# 4406|   
# 4407|->   if (def->linux)
# 4408|       {
# 4409|         uid = get_id_in_user_namespace (device->uid, true, def);

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def9]
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'receive_mounts'
crun-HEAD/src/libcrun/linux.c:4666:29: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor '*fds.fds[<unknown>]'
# 4664|   
# 4665|         if (fds->fds[index] >= 0)
# 4666|->         TEMP_FAILURE_RETRY (close (fds->fds[index]));
# 4667|   
# 4668|         fds->fds[index] = ret;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def10]
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'libcrun_join_process'
crun-HEAD/src/libcrun/linux.c:5702:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'sync_socket_fd[0]'
# 5700|   exit:
# 5701|     if (sync_socket_fd[0] >= 0)
# 5702|->     TEMP_FAILURE_RETRY (close (sync_socket_fd[0]));
# 5703|     if (sync_socket_fd[1] >= 0)
# 5704|       TEMP_FAILURE_RETRY (close (sync_socket_fd[1]));

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def11]
crun-HEAD/src/libcrun/linux.c:5704:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'sync_socket_fd[1]'
# 5702|       TEMP_FAILURE_RETRY (close (sync_socket_fd[0]));
# 5703|     if (sync_socket_fd[1] >= 0)
# 5704|->     TEMP_FAILURE_RETRY (close (sync_socket_fd[1]));
# 5705|     return ret;
# 5706|   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def12]
crun-HEAD/src/libcrun/utils.h:92:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'cwd'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'join_namespaces'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def13]
crun-HEAD/src/libcrun/utils.h:92:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'dup_options'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'maybe_create_userns_for_idmapped_mount'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'maybe_create_userns_for_idmapped_mount'
crun-HEAD/src/libcrun/linux.c:572:16: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c:572:16: note: in expansion of macro 'crun_make_error'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def14]
crun-HEAD/src/libcrun/utils.h:92:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'mappings'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'parse_idmapped_mount_option'
/usr/include/features.h:540: included_from: Included from here.
/usr/include/bits/libc-header-start.h:33: included_from: Included from here.
/usr/include/stdio.h:28: included_from: Included from here.
crun-HEAD/src/libcrun/linux.h:21: included_from: Included from here.
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'parse_idmapped_mount_option'
crun-HEAD/src/libcrun/linux.c:364:20: note: in expansion of macro 'crun_make_error'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def15]
crun-HEAD/src/libcrun/utils.h:92:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'name'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'libcrun_set_sysctl'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'libcrun_set_sysctl'
crun-HEAD/src/libcrun/linux.c:3598:20: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c:3598:20: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c:3598:20: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'libcrun_set_sysctl'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def16]
crun-HEAD/src/libcrun/utils.h:92:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'reason'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'libcrun_set_sysctl'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'libcrun_set_sysctl'
crun-HEAD/src/libcrun/linux.c:3608:16: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c:3689:18: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c:3689:18: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c:3689:18: note: in expansion of macro 'crun_make_error'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def17]
crun-HEAD/src/libcrun/utils.h:92:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'ret'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'format_mount_mappings'
crun-HEAD/src/libcrun/linux.c:443:16: note: in expansion of macro 'crun_make_error'
#   90|   {
#   91|     void **pp = (void **) p;
#   92|->   free (*pp);
#   93|   }
#   94|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def18]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'client_fd'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_closep.part.0'
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|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def19]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'current_mountns'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/linux.c:4572:13: note: in expansion of macro 'crun_make_error'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
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|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def20]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'dest_fd'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
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|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def21]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'map_fd'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'cleanup_closep.part.0'
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|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def22]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'netns_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|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def23]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'sockfd'
crun-HEAD/src/libcrun/linux.c:5792:16: note: in expansion of macro 'crun_make_error'
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|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def24]
crun-HEAD/src/libcrun/utils.h:108:25: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'sync_fd'
crun-HEAD/src/libcrun/linux.c:5279:12: note: in expansion of macro 'crun_make_error'
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|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
crun-HEAD/src/libcrun/utils.h: scope_hint: In function 'cleanup_close_mapp'
crun-HEAD/src/libcrun/utils.h:181:27: warning[-Wanalyzer-malloc-leak]: leak of 'mount_fds'
#  179|     for (i = 0; i < m->nfds; i++)
#  180|       if (m->fds[i] >= 0)
#  181|->       TEMP_FAILURE_RETRY (close (m->fds[i]));
#  182|   
#  183|     free (m);

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def26]
crun-HEAD/src/libcrun/utils.h:213:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'fd'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
#  211|     if (*fd >= 0)
#  212|       {
#  213|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  214|         if (LIKELY (ret == 0))
#  215|           *fd = -1;

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def27]
crun-HEAD/src/libcrun/utils.h:213:33: warning[-Wanalyzer-fd-double-close]: double 'close' of file descriptor 'targetfd'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
crun-HEAD/src/libcrun/linux.c: scope_hint: In function 'close_and_reset.part.0'
#  211|     if (*fd >= 0)
#  212|       {
#  213|->       ret = TEMP_FAILURE_RETRY (close (*fd));
#  214|         if (LIKELY (ret == 0))
#  215|           *fd = -1;

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.92.0
diffbase-analyzer-version-cppcheck2.19.1
diffbase-analyzer-version-gcc16.0.0
diffbase-analyzer-version-gcc-analyzer16.0.0
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-86.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.26-1.20260107111436039936.main.9.ge0a6f43f
diffbase-store-results-to/tmp/tmprbghs0su/crun-1.26-1.20260107111436039936.main.9.ge0a6f43f.tar.xz
diffbase-time-created2026-01-13 20:32:22
diffbase-time-finished2026-01-13 20:42:05
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmprbghs0su/crun-1.26-1.20260107111436039936.main.9.ge0a6f43f.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmprbghs0su/crun-1.26-1.20260107111436039936.main.9.ge0a6f43f.src.rpm'
diffbase-tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-86.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.26-1.20260113202912422543.pr1950.12.g136ef167
store-results-to/tmp/tmpe_pp6c8_/crun-1.26-1.20260113202912422543.pr1950.12.g136ef167.tar.xz
time-created2026-01-13 20:42:20
time-finished2026-01-13 20:51:05
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpe_pp6c8_/crun-1.26-1.20260113202912422543.pr1950.12.g136ef167.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpe_pp6c8_/crun-1.26-1.20260113202912422543.pr1950.12.g136ef167.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9