]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
sysstat: fix CVE-2023-33204
authorChee Yang Lee <chee.yang.lee@intel.com>
Fri, 7 Jul 2023 11:44:07 +0000 (19:44 +0800)
committerSteve Sakoman <steve@sakoman.com>
Fri, 7 Jul 2023 15:57:09 +0000 (05:57 -1000)
import patch from debian to fix CVE-2023-33204
http://security.debian.org/debian-security/pool/updates/main/s/sysstat/sysstat_12.0.3-2+deb10u2.debian.tar.xz

upstream patch:
https://github.com/sysstat/sysstat/commit/6f8dc568e6ab072bb8205b732f04e685bf9237c0

Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/recipes-extended/sysstat/sysstat/CVE-2023-33204.patch [new file with mode: 0644]
meta/recipes-extended/sysstat/sysstat_12.2.1.bb

diff --git a/meta/recipes-extended/sysstat/sysstat/CVE-2023-33204.patch b/meta/recipes-extended/sysstat/sysstat/CVE-2023-33204.patch
new file mode 100644 (file)
index 0000000..9a27945
--- /dev/null
@@ -0,0 +1,46 @@
+Origin: https://github.com/opencontainers/runc/commit/6f8dc568e6ab072bb8205b732f04e685bf9237c0
+Reviewed-by: Sylvain Beucler <beuc@debian.org>
+Last-Update: 2023-02-18
+
+From 954ff2e2673cef48f0ed44668c466eab041db387 Mon Sep 17 00:00:00 2001
+From: Pavel Kopylov <pkopylov@cloudlinux.com>
+Date: Wed, 17 May 2023 11:33:45 +0200
+Subject: [PATCH] Fix an overflow which is still possible for some values.
+
+CVE: CVE-2023-33204
+Upstream-Status: Backport [ upstream: https://github.com/sysstat/sysstat/commit/6f8dc568e6ab072bb8205b732f04e685bf9237c0 
+debian: http://security.debian.org/debian-security/pool/updates/main/s/sysstat/sysstat_12.0.3-2+deb10u2.debian.tar.xz ]
+Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
+
+---
+ common.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+Index: sysstat-12.0.3/common.c
+===================================================================
+--- sysstat-12.0.3.orig/common.c
++++ sysstat-12.0.3/common.c
+@@ -1449,15 +1449,16 @@ int parse_values(char *strargv, unsigned
+  */
+ void check_overflow(size_t val1, size_t val2, size_t val3)
+ {
+-      if ((unsigned long long) val1 *
+-          (unsigned long long) val2 *
+-          (unsigned long long) val3 > UINT_MAX) {
++      if ((val1 != 0) && (val2 != 0) && (val3 != 0) &&
++          (((unsigned long long) UINT_MAX / (unsigned long long) val1 <
++            (unsigned long long) val2) ||
++           ((unsigned long long) UINT_MAX / ((unsigned long long) val1 * (unsigned long long) val2) <
++            (unsigned long long) val3))) {
+ #ifdef DEBUG
+-              fprintf(stderr, "%s: Overflow detected (%llu). Aborting...\n",
+-                      __FUNCTION__,
+-                      (unsigned long long) val1 * (unsigned long long) val2 * (unsigned long long) val3);
++              fprintf(stderr, "%s: Overflow detected (%u,%u,%u). Aborting...\n",
++                      __FUNCTION__, val1, val2, val3);
+ #endif
+-      exit(4);
++              exit(4);
+       }
+ }
index 2c0d5c8136e408cca9784a793280877dbd0f69de..ac7b898db93e4f0bd22f815e3c960bb1e6bf0cc5 100644 (file)
@@ -4,6 +4,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a23a74b3f4caf9616230789d94217acb"
 
 SRC_URI += "file://0001-configure.in-remove-check-for-chkconfig.patch \
             file://CVE-2022-39377.patch \
+            file://CVE-2023-33204.patch \
            "
 
 SRC_URI[md5sum] = "9dfff5fac24e35bd92fb7896debf2ffb"