Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package lxcfs for openSUSE:Factory checked in at 2025-04-11 16:49:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lxcfs (Old) and /work/SRC/openSUSE:Factory/.lxcfs.new.1907 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lxcfs" Fri Apr 11 16:49:29 2025 rev:26 rq:1268503 version:6.0.4 Changes: -------- --- /work/SRC/openSUSE:Factory/lxcfs/lxcfs.changes 2024-12-22 18:04:03.043389249 +0100 +++ /work/SRC/openSUSE:Factory/.lxcfs.new.1907/lxcfs.changes 2025-04-11 16:49:40.430526269 +0200 @@ -1,0 +2,22 @@ +Sat Apr 5 18:16:48 UTC 2025 - Johannes Kastl <opensuse_buildserv...@ojkastl.de> + +- update to 6.0.4: + This is the fourth bugfix release for LXCFS 6.0 which is + supported until June 2029. + * Changes + - Properly handle SLAB reclaimable memory in meminfo + - Handle empty cpuset strings + - Fix potential sleep interval overflows + * Detailed changelog + - meminfo: Add slab_reclaimable to MemAvailable + - tests/test-read: call close(2) only if there is an fd + - utils: fix wait_for_sock to use time_t instead of int + - cpuset_parse: make a check for an empty string in + cpu_in_cpuset() + - utils: move strlcpy/strlcat helpers from cgroup_utils to + utils + - lxcfs: use strlcpy when handle runtime-dir parameter + - proc_loadavg: Prevent integer overflow calculating the sleep + interval + +------------------------------------------------------------------- Old: ---- lxcfs-6.0.3.tar.gz lxcfs-6.0.3.tar.gz.asc New: ---- lxcfs-6.0.4.tar.gz lxcfs-6.0.4.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lxcfs.spec ++++++ --- /var/tmp/diff_new_pack.LBgBBI/_old 2025-04-11 16:49:41.118555194 +0200 +++ /var/tmp/diff_new_pack.LBgBBI/_new 2025-04-11 16:49:41.118555194 +0200 @@ -1,7 +1,7 @@ # # spec file for package lxcfs # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,7 +22,7 @@ %endif Name: lxcfs -Version: 6.0.3 +Version: 6.0.4 Release: 0 Summary: FUSE filesystem for LXC License: Apache-2.0 ++++++ lxcfs-6.0.3.tar.gz -> lxcfs-6.0.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.3/meson.build new/lxcfs-6.0.4/meson.build --- old/lxcfs-6.0.3/meson.build 2024-12-19 16:38:31.000000000 +0100 +++ new/lxcfs-6.0.4/meson.build 2025-04-03 21:37:27.000000000 +0200 @@ -4,7 +4,7 @@ project( 'lxcfs', 'c', - version: '6.0.3', + version: '6.0.4', license: 'LGPLv2+', default_options: [ 'b_colorout=always', @@ -182,7 +182,7 @@ add_project_arguments('-include', 'config.h', language: 'c') # Binary. -lxcfs_sources = files('src/lxcfs.c') +lxcfs_sources = files('src/lxcfs.c', 'src/utils.c') lxcfs = executable( 'lxcfs', lxcfs_sources, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.3/src/bindings.c new/lxcfs-6.0.4/src/bindings.c --- old/lxcfs-6.0.3/src/bindings.c 2024-12-19 16:38:31.000000000 +0100 +++ new/lxcfs-6.0.4/src/bindings.c 2025-04-03 21:37:27.000000000 +0200 @@ -902,7 +902,7 @@ bool set_runtime_path(const char* new_path) { if (new_path && strlen(new_path) < PATH_MAX) { - strcpy(runtime_path, new_path); + strlcpy(runtime_path, new_path, sizeof(runtime_path)); lxcfs_info("Using runtime path %s", runtime_path); return true; } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.3/src/cgroups/cgroup.c new/lxcfs-6.0.4/src/cgroups/cgroup.c --- old/lxcfs-6.0.3/src/cgroups/cgroup.c 2024-12-19 16:38:31.000000000 +0100 +++ new/lxcfs-6.0.4/src/cgroups/cgroup.c 2025-04-03 21:37:27.000000000 +0200 @@ -24,6 +24,7 @@ #include "../macro.h" #include "../memory_utils.h" +#include "../utils.h" #include "cgroup.h" #include "cgroup_utils.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.3/src/cgroups/cgroup_utils.c new/lxcfs-6.0.4/src/cgroups/cgroup_utils.c --- old/lxcfs-6.0.3/src/cgroups/cgroup_utils.c 2024-12-19 16:38:31.000000000 +0100 +++ new/lxcfs-6.0.4/src/cgroups/cgroup_utils.c 2025-04-03 21:37:27.000000000 +0200 @@ -16,6 +16,7 @@ #include "../macro.h" #include "../memory_utils.h" +#include "../utils.h" #include "cgroup.h" #include "cgroup_utils.h" @@ -442,32 +443,6 @@ return 0; } -#if !HAVE_STRLCPY -size_t strlcpy(char *dest, const char *src, size_t size) -{ - size_t ret = strlen(src); - - if (size) { - size_t len = (ret >= size) ? size - 1 : ret; - memcpy(dest, src, len); - dest[len] = '\0'; - } - - return ret; -} -#endif - -#if !HAVE_STRLCAT -size_t strlcat(char *d, const char *s, size_t n) -{ - size_t l = strnlen(d, n); - if (l == n) - return l + strlen(s); - - return l + strlcpy(d + l, s, n - l); -} -#endif - FILE *fopen_cloexec(const char *path, const char *mode) { __do_close int fd = -EBADF; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.3/src/cgroups/cgroup_utils.h new/lxcfs-6.0.4/src/cgroups/cgroup_utils.h --- old/lxcfs-6.0.3/src/cgroups/cgroup_utils.h 2024-12-19 16:38:31.000000000 +0100 +++ new/lxcfs-6.0.4/src/cgroups/cgroup_utils.h 2025-04-03 21:37:27.000000000 +0200 @@ -61,14 +61,6 @@ extern int safe_mount(const char *src, const char *dest, const char *fstype, unsigned long flags, const void *data, const char *rootfs); -#if !HAVE_STRLCPY -extern size_t strlcpy(char *, const char *, size_t); -#endif - -#if !HAVE_STRLCAT -extern size_t strlcat(char *d, const char *s, size_t n); -#endif - extern FILE *fopen_cloexec(const char *path, const char *mode); extern void append_line(char **dest, size_t oldlen, char *new, size_t newlen); extern char *read_file(const char *fnam); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.3/src/cpuset_parse.c new/lxcfs-6.0.4/src/cpuset_parse.c --- old/lxcfs-6.0.3/src/cpuset_parse.c 2024-12-19 16:38:31.000000000 +0100 +++ new/lxcfs-6.0.4/src/cpuset_parse.c 2025-04-03 21:37:27.000000000 +0200 @@ -39,6 +39,9 @@ */ bool cpu_in_cpuset(int cpu, const char *cpuset) { + if (!strlen(cpuset)) + return false; + for (const char *c = cpuset; c; c = cpuset_nexttok(c)) { int a, b, ret; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.3/src/lxcfs.c new/lxcfs-6.0.4/src/lxcfs.c --- old/lxcfs-6.0.3/src/lxcfs.c 2024-12-19 16:38:31.000000000 +0100 +++ new/lxcfs-6.0.4/src/lxcfs.c 2025-04-03 21:37:27.000000000 +0200 @@ -31,6 +31,7 @@ #include "lxcfs_fuse_compat.h" #include "macro.h" #include "memory_utils.h" +#include "utils.h" #define PID_FILE "/lxcfs.pid" @@ -1398,10 +1399,10 @@ } if (runtime_path_arg) { - strcpy(runtime_path, runtime_path_arg); + strlcpy(runtime_path, runtime_path_arg, sizeof(runtime_path)); lxcfs_info("runtime path set to %s", runtime_path); } - strcpy(opts->runtime_path, runtime_path); + strlcpy(opts->runtime_path, runtime_path, sizeof(opts->runtime_path)); fuse_argv[fuse_argc++] = argv[0]; if (debug) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.3/src/proc_fuse.c new/lxcfs-6.0.4/src/proc_fuse.c --- old/lxcfs-6.0.3/src/proc_fuse.c 2024-12-19 16:38:31.000000000 +0100 +++ new/lxcfs-6.0.4/src/proc_fuse.c 2025-04-03 21:37:27.000000000 +0200 @@ -63,6 +63,9 @@ uint64_t total_inactive_file; uint64_t total_active_file; uint64_t total_unevictable; + uint64_t slab; + uint64_t slab_reclaimable; + uint64_t slab_unreclaimable; }; static off_t get_procfile_size(const char *path) @@ -1293,6 +1296,12 @@ sscanf(line, unified ? "active_file %" PRIu64 : "total_active_file %" PRIu64, &(mstat->total_active_file)); } else if (startswith(line, unified ? "unevictable" : "total_unevictable")) { sscanf(line, unified ? "unevictable %" PRIu64 : "total_unevictable %" PRIu64, &(mstat->total_unevictable)); + } else if (unified && startswith(line, "slab ")) { + sscanf(line, "slab %" PRIu64, &(mstat->slab)); + } else if (unified && startswith(line, "slab_reclaimable")) { + sscanf(line, "slab_reclaimable %" PRIu64, &(mstat->slab_reclaimable)); + } else if (unified && startswith(line, "slab_unreclaimable")) { + sscanf(line, "slab_unreclaimable %" PRIu64, &(mstat->slab_unreclaimable)); } } @@ -1389,7 +1398,8 @@ snprintf(lbuf, 100, "MemFree: %8" PRIu64 " kB\n", memlimit - memusage); printme = lbuf; } else if (startswith(line, "MemAvailable:")) { - snprintf(lbuf, 100, "MemAvailable: %8" PRIu64 " kB\n", memlimit - memusage + (mstat.total_active_file + mstat.total_inactive_file) / 1024); + snprintf(lbuf, 100, "MemAvailable: %8" PRIu64 " kB\n", memlimit - memusage + + (mstat.total_active_file + mstat.total_inactive_file + mstat.slab_reclaimable) / 1024); printme = lbuf; } else if (startswith(line, "SwapTotal:")) { if (wants_swap) { @@ -1424,7 +1434,7 @@ snprintf(lbuf, 100, "SwapFree: %8" PRIu64 " kB\n", swfree); printme = lbuf; } else if (startswith(line, "Slab:")) { - snprintf(lbuf, 100, "Slab: %8" PRIu64 " kB\n", (uint64_t)0); + snprintf(lbuf, 100, "Slab: %8" PRIu64 " kB\n", mstat.slab / 1024); printme = lbuf; } else if (startswith(line, "Buffers:")) { snprintf(lbuf, 100, "Buffers: %8" PRIu64 " kB\n", (uint64_t)0); @@ -1487,10 +1497,10 @@ mstat.total_mapped_file / 1024); printme = lbuf; } else if (startswith(line, "SReclaimable:")) { - snprintf(lbuf, 100, "SReclaimable: %8" PRIu64 " kB\n", (uint64_t)0); + snprintf(lbuf, 100, "SReclaimable: %8" PRIu64 " kB\n", mstat.slab_reclaimable / 1024); printme = lbuf; } else if (startswith(line, "SUnreclaim:")) { - snprintf(lbuf, 100, "SUnreclaim: %8" PRIu64 " kB\n", (uint64_t)0); + snprintf(lbuf, 100, "SUnreclaim: %8" PRIu64 " kB\n", mstat.slab_unreclaimable / 1024); printme = lbuf; } else if (startswith(line, "Shmem:")) { snprintf(lbuf, 100, "Shmem: %8" PRIu64 " kB\n", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.3/src/proc_loadavg.c new/lxcfs-6.0.4/src/proc_loadavg.c --- old/lxcfs-6.0.3/src/proc_loadavg.c 2024-12-19 16:38:31.000000000 +0100 +++ new/lxcfs-6.0.4/src/proc_loadavg.c 2025-04-03 21:37:27.000000000 +0200 @@ -504,6 +504,7 @@ int first_node, sum; struct load_node *f; clock_t time1, time2; + int sleep_time; for (;;) { if (loadavg_stop == 1) @@ -542,8 +543,9 @@ return NULL; time2 = clock(); - usleep(FLUSH_TIME * 1000000 - - (int)((time2 - time1) * 1000000 / CLOCKS_PER_SEC)); + sleep_time = FLUSH_TIME - (int)((time2 - time1) / CLOCKS_PER_SEC); + if ((sleep_time > 0) && (sleep_time <= FLUSH_TIME)) + usleep(sleep_time * 1000000); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.3/src/utils.c new/lxcfs-6.0.4/src/utils.c --- old/lxcfs-6.0.3/src/utils.c 2024-12-19 16:38:31.000000000 +0100 +++ new/lxcfs-6.0.4/src/utils.c 2025-04-03 21:37:27.000000000 +0200 @@ -164,7 +164,8 @@ { __do_close int epfd = -EBADF; struct epoll_event ev; - int ret, now, starttime, deltatime; + int ret; + time_t now, starttime, deltatime; if ((starttime = time(NULL)) < 0) return false; @@ -713,3 +714,29 @@ return could_access_init_personality != 0; } + +#if !HAVE_STRLCPY +size_t strlcpy(char *dest, const char *src, size_t size) +{ + size_t ret = strlen(src); + + if (size) { + size_t len = (ret >= size) ? size - 1 : ret; + memcpy(dest, src, len); + dest[len] = '\0'; + } + + return ret; +} +#endif + +#if !HAVE_STRLCAT +size_t strlcat(char *d, const char *s, size_t n) +{ + size_t l = strnlen(d, n); + if (l == n) + return l + strlen(s); + + return l + strlcpy(d + l, s, n - l); +} +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.3/src/utils.h new/lxcfs-6.0.4/src/utils.h --- old/lxcfs-6.0.3/src/utils.h 2024-12-19 16:38:31.000000000 +0100 +++ new/lxcfs-6.0.4/src/utils.h 2025-04-03 21:37:27.000000000 +0200 @@ -82,4 +82,12 @@ extern bool can_access_personality(void); extern int get_host_personality(__u32 *personality); +#if !HAVE_STRLCPY +extern size_t strlcpy(char *, const char *, size_t); +#endif + +#if !HAVE_STRLCAT +extern size_t strlcat(char *d, const char *s, size_t n); +#endif + #endif /* __LXCFS_UTILS_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.3/tests/test-read.c new/lxcfs-6.0.4/tests/test-read.c --- old/lxcfs-6.0.3/tests/test-read.c 2024-12-19 16:38:31.000000000 +0100 +++ new/lxcfs-6.0.4/tests/test-read.c 2025-04-03 21:37:27.000000000 +0200 @@ -45,6 +45,7 @@ sleep(1); } printf("======read sum: %d======\n", sum); - close(fd); + if (fd >= 0) + close(fd); return 0; }