#1050786 cgget: buffer overflow detected; Aborted (core dumped)

Package:
cgroup-tools
Source:
cgroup-tools
Description:
control and monitor control groups (tools)
Submitter:
Tj
Date:
2023-08-29 08:45:03 UTC
Severity:
normal
#1050786#5
Date:
2023-08-29 08:41:55 UTC
From:
To:
I was casually using the tools to explore v2 configuration and found
that a simple:

  $ cgget -a
  *** buffer overflow detected ***: terminated
  Aborted (core dumped)

crashes. Under strace I see:

newfstatat(AT_FDCWD, "/sys/fs/cgroup/cpuset.mems.effective", {st_mode=S_IFREG|0444, st_size=0, ...}, 0) = 0
newfstatat(AT_FDCWD, "/sys/fs/cgroup/cgroup.subtree_control", {st_mode=S_IFREG|0644, st_size=0, ...}, 0) = 0
newfstatat(AT_FDCWD, "/sys/fs/cgroup/memory.reclaim", {st_mode=S_IFREG|0200, st_size=0, ...}, 0) = 0
newfstatat(AT_FDCWD, "/sys/fs/cgroup/cgroup.max.depth", {st_mode=S_IFREG|0644, st_size=0, ...}, 0) = 0
newfstatat(AT_FDCWD, "/sys/fs/cgroup/cgroup.pressure", {st_mode=S_IFREG|0644, st_size=0, ...}, 0) = 0
newfstatat(AT_FDCWD, "/sys/fs/cgroup/io.stat", {st_mode=S_IFREG|0444, st_size=0, ...}, 0) = 0
openat(AT_FDCWD, "/sys/fs/cgroup/io.stat", O_RDONLY|O_CLOEXEC) = 4
newfstatat(4, "", {st_mode=S_IFREG|0444, st_size=0, ...}, AT_EMPTY_PATH) = 0
read(4, "8:64 rbytes=2230784 wbytes=0 rio"..., 4096) = 4096
close(4)                                = 0
writev(2, [{iov_base="*** ", iov_len=4}, {iov_base="buffer overflow detected", iov_len=24}, {iov_base=" ***: terminated\n", iov_len=17}], 3*** buffer overflow detected ***: terminated
) = 45
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fdf94e01000
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
gettid()                                = 138582
getpid()                                = 138582
tgkill(138582, 138582, SIGABRT)         = 0
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=138582, si_uid=1000} ---
+++ killed by SIGABRT (core dumped) +++
Aborted (core dumped)