Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zlib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
staging
rpms
zlib
Commits
07e1d59e
Commit
07e1d59e
authored
2 years ago
by
Rocky Automation
Browse files
Options
Downloads
Patches
Plain Diff
import zlib-1.2.11-34.el9
parent
b90ffffa
No related branches found
Branches containing commit
Tags
imports/r9/zlib-1.2.11-34.el9
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SOURCES/zlib-1.2.11-IBM-Z-hw-accelrated-deflate-compressBound-fix.patch
+90
-0
90 additions, 0 deletions
....2.11-IBM-Z-hw-accelrated-deflate-compressBound-fix.patch
SPECS/zlib.spec
+9
-3
9 additions, 3 deletions
SPECS/zlib.spec
with
99 additions
and
3 deletions
SOURCES/zlib-1.2.11-IBM-Z-hw-accelrated-deflate-compressBound-fix.patch
0 → 100644
+
90
−
0
View file @
07e1d59e
--- a/compress.c
+++ b/compress.c
@@ -5,9 +5,15 @@
/* @(#) $Id$ */
-#define ZLIB_INTERNAL
+#include "zutil.h"
#include "zlib.h"
+#ifdef DFLTCC
+# include "contrib/s390/dfltcc.h"
+#else
+#define DEFLATE_BOUND_COMPLEN(source_len) 0
+#endif
+
/* ===========================================================================
Compresses the source buffer into the destination buffer. The level
parameter has the same meaning as in deflateInit. sourceLen is the byte
@@ -81,6 +87,12 @@
int ZEXPORT compress (dest, destLen, source, sourceLen)
uLong ZEXPORT compressBound (sourceLen)
uLong sourceLen;
{
+ uLong complen = DEFLATE_BOUND_COMPLEN(sourceLen);
+
+ if (complen > 0)
+ /* Architecture-specific code provided an upper bound. */
+ return complen + ZLIB_WRAPLEN;
+
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
(sourceLen >> 25) + 13;
}
--- a/contrib/s390/dfltcc.h
+++ b/contrib/s390/dfltcc.h
@@ -12,6 +12,28 @@
void ZLIB_INTERNAL dfltcc_reset OF((z_streamp strm, uInt size));
voidpf ZLIB_INTERNAL dfltcc_alloc_window OF((z_streamp strm, uInt items,
uInt size));
void ZLIB_INTERNAL dfltcc_free_window OF((z_streamp strm, voidpf w));
+#define DFLTCC_BLOCK_HEADER_BITS 3
+#define DFLTCC_HLITS_COUNT_BITS 5
+#define DFLTCC_HDISTS_COUNT_BITS 5
+#define DFLTCC_HCLENS_COUNT_BITS 4
+#define DFLTCC_MAX_HCLENS 19
+#define DFLTCC_HCLEN_BITS 3
+#define DFLTCC_MAX_HLITS 286
+#define DFLTCC_MAX_HDISTS 30
+#define DFLTCC_MAX_HLIT_HDIST_BITS 7
+#define DFLTCC_MAX_SYMBOL_BITS 16
+#define DFLTCC_MAX_EOBS_BITS 15
+#define DFLTCC_MAX_PADDING_BITS 7
+#define DEFLATE_BOUND_COMPLEN(source_len) \
+ ((DFLTCC_BLOCK_HEADER_BITS + \
+ DFLTCC_HLITS_COUNT_BITS + \
+ DFLTCC_HDISTS_COUNT_BITS + \
+ DFLTCC_HCLENS_COUNT_BITS + \
+ DFLTCC_MAX_HCLENS * DFLTCC_HCLEN_BITS + \
+ (DFLTCC_MAX_HLITS + DFLTCC_MAX_HDISTS) * DFLTCC_MAX_HLIT_HDIST_BITS + \
+ (source_len) * DFLTCC_MAX_SYMBOL_BITS + \
+ DFLTCC_MAX_EOBS_BITS + \
+ DFLTCC_MAX_PADDING_BITS) >> 3)
int ZLIB_INTERNAL dfltcc_can_inflate OF((z_streamp strm));
typedef enum {
DFLTCC_INFLATE_CONTINUE,
diff --git a/contrib/s390/dfltcc_deflate.h b/contrib/s390/dfltcc_deflate.h
index 03f7f53..46acfc5 100644
--- a/contrib/s390/dfltcc_deflate.h
+++ b/contrib/s390/dfltcc_deflate.h
@@ -46,8 +46,7 @@
int ZLIB_INTERNAL dfltcc_deflate_get_dictionary OF((z_streamp strm,
#define DEFLATE_BOUND_ADJUST_COMPLEN(strm, complen, source_len) \
do { \
if (dfltcc_can_deflate((strm))) \
- (complen) = (3 + 5 + 5 + 4 + 19 * 3 + (286 + 30) * 7 + \
- (source_len) * 16 + 15 + 7) >> 3; \
+ (complen) = DEFLATE_BOUND_COMPLEN(source_len); \
} while (0)
#define DEFLATE_NEED_CONSERVATIVE_BOUND(strm) (dfltcc_can_deflate((strm)))
#define DEFLATE_HOOK dfltcc_deflate
diff --git a/zutil.h b/zutil.h
index 14277bc..cf90e49 100644
--- a/zutil.h
+++ b/zutil.h
@@ -87,6 +87,8 @@
extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
+#define ZLIB_WRAPLEN 6 /* zlib format overhead */
+
/* target dependencies */
#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
This diff is collapsed.
Click to expand it.
SPECS/zlib.spec
+
9
−
3
View file @
07e1d59e
...
...
@@ -2,7 +2,7 @@
Name: zlib
Version: 1.2.11
Release: 3
2
%{?dist}
Release: 3
4
%{?dist}
Summary: Compression and decompression library
# /contrib/dotzlib/ have Boost license
License: zlib and Boost
...
...
@@ -35,6 +35,8 @@ Patch14: zlib-1.2.11-inflateSyncPoint-return-value-fix.patch
Patch15: zlib-1.2.11-covscan-issues-rhel9.patch
# Fix for s390x vectorize CRC32
Patch16: zlib-1.2.11-s390x-vectorize-crc32.patch
# fix for IBM Z optimalizations
Patch17: zlib-1.2.11-IBM-Z-hw-accelrated-deflate-compressBound-fix.patch
Patch18: zlib-1.2.11-CVE-2018-25032.patch
# Fix for CVE-2022-37434
...
...
@@ -109,6 +111,7 @@ developing applications which use minizip.
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
...
...
@@ -189,14 +192,17 @@ find $RPM_BUILD_ROOT -name '*.la' -delete
%changelog
* Wed Aug 10 2022 Matej Mužila <mmuzila@redhat.com> - 1.2.11-3
2
* Wed Aug 10 2022 Matej Mužila <mmuzila@redhat.com> - 1.2.11-3
4
- Fix heap-based buffer over-read or buffer overflow in inflate in inflate.c
- Resolves: CVE-2022-37434
* Mon Apr 25 2022 Matej Mužila <mmuzila@redhat.com> - 1.2.11-3
1.1
* Mon Apr 25 2022 Matej Mužila <mmuzila@redhat.com> - 1.2.11-3
3
- Fix CVE-2018-25032
Resolves: CVE-2018-25032
* Tue Mar 01 2022 Ilya Leoshkevich <iii@linux.ibm.com> - 1.2.11-32
- Fix for IBM compressBound() rhbz#2056899
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1.2.11-31
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment