diff --git a/backport-CVE-2023-33204.patch b/backport-CVE-2023-33204.patch new file mode 100644 index 0000000000000000000000000000000000000000..7b0d2b570b7febbb200df97c72eda2698478c24e --- /dev/null +++ b/backport-CVE-2023-33204.patch @@ -0,0 +1,42 @@ +From 954ff2e2673cef48f0ed44668c466eab041db387 Mon Sep 17 00:00:00 2001 +From: Pavel Kopylov +Date: Wed, 17 May 2023 11:33:45 +0200 +Subject: [PATCH] Fix an overflow which is still possible for some values. + +Reference:https://github.com/sysstat/sysstat/commit/6f8dc568e6ab072bb8205b732f04e685bf9237c0 +Conflict:Adaptation Context +--- + common.c | 16 +++++++++------- + 1 file changed, 9 insertions(+), 7 deletions(-) + +diff --git a/common.c b/common.c +index a3d31a5..8c3d28a 100644 +--- a/common.c ++++ b/common.c +@@ -447,15 +447,17 @@ int check_dir(char *dirname) + void check_overflow(unsigned int val1, unsigned int val2, + unsigned int 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); ++ } + } + + #ifndef SOURCE_SADC +-- +2.33.0 diff --git a/sysstat.spec b/sysstat.spec index 8fa383a406ee560b106db5d32cce52279ca2d8de..4d3549f2d575d0300fc303d531b81ed1e3547866 100644 --- a/sysstat.spec +++ b/sysstat.spec @@ -1,6 +1,6 @@ Name: sysstat Version: 12.6.2 -Release: 2 +Release: 3 Summary: System performance tools for the Linux operating system License: GPLv2+ URL: http://sebastien.godard.pagesperso-orange.fr/ @@ -13,6 +13,7 @@ Requires(post): systemd Requires(preun): systemd Requires(postun): systemd +Patch6000: backport-CVE-2023-33204.patch Patch9000: bugfix-sysstat-10.1.5-read-ttyAMA-first-for-arm64.patch %description @@ -86,6 +87,9 @@ export compressafter="31" %{_mandir}/man*/* %changelog +* Thu May 25 2023 zhouwenpei - 12.6.2-3 +- fix CVE-2023-33204 + * Fri Apr 14 2023 wangjiang - 12.6.2-2 - service auto start after install