Task #1554 - fixed.err

back to task #1554
download
Error: GCC_ANALYZER_WARNING (CWE-126):
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):
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):
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;