Accepting request 1088723 from home:david.anes:branches:Base:System

- Security fix: (CVE-2023-33204, bsc#1211507)
  * Fix an overflow which is still possible for some values.

OBS-URL: https://build.opensuse.org/request/show/1088723
OBS-URL: https://build.opensuse.org/package/show/Base:System/sysstat?expand=0&rev=144
This commit is contained in:
David Anes 2023-05-26 17:23:51 +00:00 committed by Git OBS Bridge
parent b30d1b71e0
commit 01ede62d17
3 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,38 @@
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.
---
common.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
Index: sysstat-12.6.2/common.c
===================================================================
--- sysstat-12.6.2.orig/common.c
+++ sysstat-12.6.2/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

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue May 23 18:36:01 UTC 2023 - David Anes <david.anes@suse.com>
- Security fix: (CVE-2023-33204, bsc#1211507)
* Fix an overflow which is still possible for some values.
-------------------------------------------------------------------
Fri Apr 14 17:14:24 UTC 2023 - David Anes <david.anes@suse.com>

View File

@ -34,6 +34,8 @@ Patch2: sysstat-8.0.4-pagesize.diff
# PATCH-FIX-OPENSUSE bsc#1151453
Patch3: sysstat-service.patch
Patch4: harden_sysstat.service.patch
# PATCH-FIX-UPSTREAM CVE-2023-33204, bsc#1211507 https://github.com/sysstat/sysstat/pull/360.patch
Patch5: sysstat-CVE-2023-33204.patch
BuildRequires: findutils
BuildRequires: gettext-runtime
BuildRequires: libpcp-devel
@ -79,6 +81,7 @@ cp %{SOURCE1} .
# remove date and time from objects
find ./ -name \*.c -exec sed -i -e 's: " compiled " __DATE__ " " __TIME__::g' {} \;
%patch4 -p1
%patch5 -p1
%build
export conf_dir="%{_sysconfdir}/sysstat"