Fixed defects

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-126): [#def1]
systemd-stable-255.4/src/core/namespace.c:662:35: warning[-Wanalyzer-out-of-bounds]: buffer over-read
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:2105:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/core/namespace.c:2109:9: note: in expansion of macro ‘BLOCK_WITH_UMASK’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:400:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:424:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/fundamental/macro-fundamental.h:70:44: note: in definition of macro ‘_unlikely_’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:425:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:425:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/macro.h:278:34: note: in definition of macro ‘_FOREACH_ARRAY’
systemd-stable-255.4/src/core/namespace.c:427:9: note: in expansion of macro ‘FOREACH_ARRAY’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:608:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/fundamental/macro-fundamental.h:70:44: note: in definition of macro ‘_unlikely_’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:609:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:609:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/macro.h:278:34: note: in definition of macro ‘_FOREACH_ARRAY’
systemd-stable-255.4/src/core/namespace.c:611:9: note: in expansion of macro ‘FOREACH_ARRAY’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:446:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/fundamental/macro-fundamental.h:70:44: note: in definition of macro ‘_unlikely_’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:447:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:447:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/macro.h:278:34: note: in definition of macro ‘_FOREACH_ARRAY’
systemd-stable-255.4/src/core/namespace.c:449:9: note: in expansion of macro ‘FOREACH_ARRAY’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:479:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:649:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/fundamental/macro-fundamental.h:70:44: note: in definition of macro ‘_unlikely_’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:650:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:650:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/macro.h:278:34: note: in definition of macro ‘_FOREACH_ARRAY’
systemd-stable-255.4/src/core/namespace.c:654:9: note: in expansion of macro ‘FOREACH_ARRAY’
systemd-stable-255.4/src/basic/macro.h:282:9: note: in expansion of macro ‘_FOREACH_ARRAY’
systemd-stable-255.4/src/core/namespace.c:654:9: note: in expansion of macro ‘FOREACH_ARRAY’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:354:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/alloc-util.h:155:45: note: in definition of macro ‘GREEDY_REALLOC0’
systemd-stable-255.4/src/basic/macro.h:148:21: note: in expansion of macro ‘_unlikely_’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:272:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:272:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/core/namespace.c: scope_hint: In function ‘append_static_mounts’
systemd-stable-255.4/src/basic/macro.h:282:9: note: in expansion of macro ‘_FOREACH_ARRAY’
systemd-stable-255.4/src/core/namespace.c:654:9: note: in expansion of macro ‘FOREACH_ARRAY’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:354:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/alloc-util.h:155:45: note: in definition of macro ‘GREEDY_REALLOC0’
systemd-stable-255.4/src/basic/macro.h:148:21: note: in expansion of macro ‘_unlikely_’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:272:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:272:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/core/namespace.c: scope_hint: In function ‘append_static_mounts’
systemd-stable-255.4/src/core/namespace.c:662:35: note: read of 112 bytes from after the end of ‘protect_kernel_modules_table’
systemd-stable-255.4/src/core/namespace.c:662:35: note: valid subscripts for ‘protect_kernel_modules_table’ are ‘[0]’ to ‘[0]’
#                                                                       └─────────────────────────────────────────────┘
#                                                                                              ^
#  660|                           .path_const = mount_entry_path(m),
#  661|                           .mode = m->mode,
#  662|->                         .ignore = m->ignore || ignore_protect,
#  663|                   };
#  664|           }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
systemd-stable-255.4/src/core/namespace.c: scope_hint: In function ‘setup_shareable_ns’
systemd-stable-255.4/src/core/namespace.c:2936:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(__builtin_alloca(max(_n_, 1)), 524544)’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:2897:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/fundamental/macro-fundamental.h:70:44: note: in definition of macro ‘_unlikely_’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:2898:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:2898:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/fundamental/macro-fundamental.h:126:37: note: in definition of macro ‘_ASSERT_PTR’
systemd-stable-255.4/src/core/namespace.c:2900:19: note: in expansion of macro ‘ASSERT_PTR’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/fundamental/macro-fundamental.h:127:17: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/fundamental/macro-fundamental.h:122:26: note: in expansion of macro ‘_ASSERT_PTR’
systemd-stable-255.4/src/core/namespace.c:2900:19: note: in expansion of macro ‘ASSERT_PTR’
systemd-stable-255.4/src/fundamental/macro-fundamental.h:104:28: note: in definition of macro ‘XCONCATENATE’
systemd-stable-255.4/src/basic/lock-util.h:27:49: note: in expansion of macro ‘CONCATENATE’
systemd-stable-255.4/src/core/namespace.c:2912:9: note: in expansion of macro ‘CLEANUP_POSIX_UNLOCK’
systemd-stable-255.4/src/core/namespace.c:2935:19: note: in expansion of macro ‘strjoina’
systemd-stable-255.4/src/core/namespace.c:2935:19: note: in expansion of macro ‘strjoina’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/basic/alloc-util.h:30:17: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/alloc-util.h:38:22: note: in expansion of macro ‘alloca_safe’
systemd-stable-255.4/src/basic/string-util.h:121:29: note: in expansion of macro ‘newa’
systemd-stable-255.4/src/core/namespace.c:2935:19: note: in expansion of macro ‘strjoina’
systemd-stable-255.4/src/core/namespace.c:2935:19: note: in expansion of macro ‘strjoina’
systemd-stable-255.4/src/core/namespace.c:2935:19: note: in expansion of macro ‘strjoina’
# 2934|   
# 2935|           ns_path = strjoina("/proc/self/ns/", ns_name);
# 2936|->         ns = open(ns_path, O_RDONLY|O_CLOEXEC|O_NOCTTY);
# 2937|           if (ns < 0)
# 2938|                   return -errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
systemd-stable-255.4/src/core/namespace.c: scope_hint: In function ‘open_shareable_ns_path’
systemd-stable-255.4/src/core/namespace.c:2974:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 524544)’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:2952:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/fundamental/macro-fundamental.h:70:44: note: in definition of macro ‘_unlikely_’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:2953:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:2953:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/macro.h:148:21: note: in expansion of macro ‘_unlikely_’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:2954:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/basic/macro.h:165:22: note: in expansion of macro ‘assert_message_se’
systemd-stable-255.4/src/core/namespace.c:2954:9: note: in expansion of macro ‘assert’
systemd-stable-255.4/src/fundamental/macro-fundamental.h:104:28: note: in definition of macro ‘XCONCATENATE’
systemd-stable-255.4/src/basic/lock-util.h:27:49: note: in expansion of macro ‘CONCATENATE’
systemd-stable-255.4/src/core/namespace.c:2964:9: note: in expansion of macro ‘CLEANUP_POSIX_UNLOCK’
# 2972|           /* Nothing stored yet. Open the file from the file system. */
# 2973|   
# 2974|->         ns = open(path, O_RDONLY|O_NOCTTY|O_CLOEXEC);
# 2975|           if (ns < 0)
# 2976|                   return -errno;

Scan Properties

analyzer-version-clang18.1.1
analyzer-version-cppcheck2.13.0
analyzer-version-gcc14.0.1
analyzer-version-gcc-analyzer14.0.1
analyzer-version-shellcheck0.9.0
diffbase-analyzer-version-clang18.1.1
diffbase-analyzer-version-cppcheck2.13.0
diffbase-analyzer-version-gcc14.0.1
diffbase-analyzer-version-gcc-analyzer14.0.1
diffbase-analyzer-version-shellcheck0.9.0
diffbase-enabled-pluginsclang, cppcheck, gcc, shellcheck
diffbase-exit-code0
diffbase-hostip-172-16-1-74.us-west-2.compute.internal
diffbase-mock-configfedora-40-x86_64
diffbase-project-namesystemd-255.4-1.fc41
diffbase-store-results-to/tmp/tmpkxxq_l1c/systemd-255.4-1.fc41.tar.xz
diffbase-time-created2024-04-13 08:29:14
diffbase-time-finished2024-04-13 09:29:19
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-40-x86_64' '-t' 'shellcheck,clang,gcc,cppcheck' '-o' '/tmp/tmpkxxq_l1c/systemd-255.4-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpkxxq_l1c/systemd-255.4-1.fc41.src.rpm'
diffbase-tool-versioncsmock-3.5.3-1.el9
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-74.us-west-2.compute.internal
mock-configfedora-40-x86_64
project-namesystemd-255.4-1.fc40
store-results-to/tmp/tmp08a4wqdv/systemd-255.4-1.fc40.tar.xz
time-created2024-04-13 07:26:23
time-finished2024-04-13 08:27:58
titleFixed defects
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-40-x86_64' '-t' 'shellcheck,clang,gcc,cppcheck' '-o' '/tmp/tmp08a4wqdv/systemd-255.4-1.fc40.tar.xz' '--gcc-analyze' '/tmp/tmp08a4wqdv/systemd-255.4-1.fc40.src.rpm'
tool-versioncsmock-3.5.3-1.el9