[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#982285: libcgroup1: invalid memory access in cgroup_strerror



Package: libcgroup1
Version: 0.41-8.1
Severity: important
Tags: patch upstream

cgroup_strerror_codes in src/api.c does not match to ECG* error enum
defined in include/libcgroup/error.h

This may lead to returning invalid error message from cgroup_strerror()
or accessing out of archive boundary when cgroup_strerror is called with
code=ECGNONEMPTY.

I have added one more error message to fill the gap between ECGMOUNTFAIL
(50021 - Cgroup mounting failed) and ECGEOF (50023 - End of File or
iterator) messages.

Upstream patch: https://sourceforge.net/p/libcg/patches/7/

-- System Information:
Debian Release: 10.8
  APT prefers stable
  APT policy: (990, 'stable'), (650, 'testing'), (500, 'stable-updates'), (50, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-14-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8), LANGUAGE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages libcgroup1 depends on:
ii  libc6  2.28-10

libcgroup1 recommends no packages.

libcgroup1 suggests no packages.

-- no debconf information
>From 632fb6181c522a46f032f8d7fb16b36c2fa3aff6 Mon Sep 17 00:00:00 2001
From: Alexander Galanin <al@galanin.nnov.ru>
Date: Mon, 8 Feb 2021 12:09:42 +0300
Subject: [PATCH] fix error message array

---
 src/api.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/api.c b/src/api.c
index bfd0177..e383992 100644
--- a/src/api.c
+++ b/src/api.c
@@ -104,6 +104,7 @@ const char const *cgroup_strerror_codes[] = {
 	"Cgroup parsing failed",
 	"Cgroup, rules file does not exist",
 	"Cgroup mounting failed",
+	"Unexpected error 50022",
 	"End of File or iterator",
 	"Failed to parse config file",
 	"Have multiple paths for the same namespace",
-- 
2.20.1


Reply to: