Skip to content

IBM zSystems DFLTCC: Do not update strm.adler for raw streams#1390

Merged
Dead2 merged 1 commit intozlib-ng:developfrom
iii-i:dfltcc-strm-adler-raw
Jan 9, 2023
Merged

IBM zSystems DFLTCC: Do not update strm.adler for raw streams#1390
Dead2 merged 1 commit intozlib-ng:developfrom
iii-i:dfltcc-strm-adler-raw

Conversation

@iii-i
Copy link
Copy Markdown
Member

@iii-i iii-i commented Dec 22, 2022

Commit d38dd92 ("IBM Z DFLTCC: Fix updating strm.adler with inflate()") broke libxml2, as can be seen with the repro from [1]:

$ echo "<a></a>" | gzip >file.xml.gz
$ python3 -c 'import libxml2; libxml2.parseFile("file.xml.gz")'
file.xml.gz:1: parser error : Document is empty

This is because libxml2 expects strm.adler to be untouched for raw streams.

Fix this and a similar issue in deflate by adding state->wrap checks. Add tests.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2155328
[2] https://gitlab.gnome.org/GNOME/libxml2/-/blob/v2.10.3/xzlib.c#L607

Commit d38dd92 ("IBM Z DFLTCC: Fix updating strm.adler with
inflate()") broke libxml2, as can be seen with the repro from [1]:

    $ echo "<a></a>" | gzip >file.xml.gz
    $ python3 -c 'import libxml2; libxml2.parseFile("file.xml.gz")'
    file.xml.gz:1: parser error : Document is empty

This is because libxml2 expects strm.adler to be untouched for raw
streams.

Fix this and a similar issue in deflate by adding state->wrap checks.
Add tests.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2155328
[2] https://gitlab.gnome.org/GNOME/libxml2/-/blob/v2.10.3/xzlib.c#L607
@codecov
Copy link
Copy Markdown

codecov bot commented Dec 22, 2022

Codecov Report

Base: 83.23% // Head: 83.23% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (cc06335) compared to base (31ce5ef).
Patch coverage: 80.76% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1390      +/-   ##
===========================================
- Coverage    83.23%   83.23%   -0.01%     
===========================================
  Files          129      130       +1     
  Lines        10745    10791      +46     
  Branches      2772     2796      +24     
===========================================
+ Hits          8944     8982      +38     
+ Misses        1118     1117       -1     
- Partials       683      692       +9     
Flag Coverage Δ
macos_clang 41.83% <0.00%> (-0.06%) ⬇️
macos_gcc 73.16% <75.00%> (+<0.01%) ⬆️
ubuntu_clang 82.55% <ø> (-0.19%) ⬇️
ubuntu_clang_debug 82.38% <ø> (ø)
ubuntu_clang_inflate_allow_invalid_dist 82.20% <ø> (-0.19%) ⬇️
ubuntu_clang_inflate_strict 82.73% <ø> (ø)
ubuntu_clang_mmap 83.06% <ø> (ø)
ubuntu_clang_pigz 13.63% <ø> (ø)
ubuntu_clang_pigz_no_optim 10.92% <ø> (ø)
ubuntu_clang_pigz_no_threads 13.58% <ø> (ø)
ubuntu_clang_reduced_mem 83.23% <ø> (ø)
ubuntu_gcc 74.58% <55.00%> (-0.15%) ⬇️
ubuntu_gcc_aarch64 76.95% <55.00%> (-0.12%) ⬇️
ubuntu_gcc_aarch64_compat_no_opt 75.43% <75.00%> (-0.02%) ⬇️
ubuntu_gcc_aarch64_no_acle 75.98% <75.00%> (-0.01%) ⬇️
ubuntu_gcc_aarch64_no_neon 75.98% <75.00%> (-0.01%) ⬇️
ubuntu_gcc_armhf 77.02% <55.00%> (-0.12%) ⬇️
ubuntu_gcc_armhf_compat_no_opt 75.40% <75.00%> (-0.02%) ⬇️
ubuntu_gcc_armhf_no_acle 77.02% <55.00%> (-0.12%) ⬇️
ubuntu_gcc_armhf_no_neon 76.93% <55.00%> (-0.12%) ⬇️
ubuntu_gcc_armsf 74.58% <67.74%> (-0.04%) ⬇️
ubuntu_gcc_armsf_compat_no_opt 74.06% <67.74%> (-0.04%) ⬇️
ubuntu_gcc_benchmark 73.53% <67.74%> (-0.03%) ⬇️
ubuntu_gcc_compat_no_opt 76.43% <55.00%> (-0.14%) ⬇️
ubuntu_gcc_compat_sprefix 73.38% <67.74%> (-0.03%) ⬇️
ubuntu_gcc_m32 73.00% <67.74%> (-0.03%) ⬇️
ubuntu_gcc_mingw_i686 73.19% <69.69%> (-0.02%) ⬇️
ubuntu_gcc_mingw_x86_64 73.23% <69.69%> (-0.02%) ⬇️
ubuntu_gcc_no_avx2 73.96% <75.00%> (+<0.01%) ⬆️
ubuntu_gcc_no_ctz 74.66% <67.74%> (-0.04%) ⬇️
ubuntu_gcc_no_ctzll 74.68% <67.74%> (-0.04%) ⬇️
ubuntu_gcc_no_pclmulqdq 73.85% <75.00%> (+<0.01%) ⬆️
ubuntu_gcc_no_sse2 74.12% <75.00%> (+<0.01%) ⬆️
ubuntu_gcc_no_sse4 73.77% <75.00%> (+<0.01%) ⬆️
ubuntu_gcc_o1 73.63% <75.00%> (+<0.01%) ⬆️
ubuntu_gcc_osb ∅ <ø> (∅)
ubuntu_gcc_pigz 38.30% <ø> (ø)
ubuntu_gcc_pigz_aarch64 39.64% <ø> (+0.08%) ⬆️
ubuntu_gcc_ppc 73.66% <67.74%> (-0.04%) ⬇️
ubuntu_gcc_ppc64 74.36% <67.74%> (-0.04%) ⬇️
ubuntu_gcc_ppc_no_power8 74.53% <67.74%> (-0.04%) ⬇️
ubuntu_gcc_s390x 74.76% <67.74%> (-0.04%) ⬇️
ubuntu_gcc_s390x_dfltcc 71.78% <76.74%> (+<0.01%) ⬆️
ubuntu_gcc_s390x_dfltcc_compat 73.55% <80.76%> (+0.02%) ⬆️
ubuntu_gcc_s390x_no_crc32 74.55% <67.74%> (-0.04%) ⬇️
ubuntu_gcc_sprefix 73.06% <67.74%> (-0.03%) ⬇️
win64_gcc 73.67% <69.69%> (-0.02%) ⬇️
win64_gcc_compat_no_opt 74.75% <69.69%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
test/test_raw.cc 74.35% <74.35%> (ø)
arch/s390/dfltcc_deflate.c 75.13% <100.00%> (+0.53%) ⬆️
arch/s390/dfltcc_inflate.c 85.45% <100.00%> (+0.26%) ⬆️
test/test_deflate_header.cc 97.22% <100.00%> (+0.07%) ⬆️
gzlib.c 70.60% <0.00%> (ø)
arch/x86/adler32_sse42.c 100.00% <0.00%> (+1.53%) ⬆️
adler32_p.h 100.00% <0.00%> (+3.57%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Copy Markdown
Member

@Dead2 Dead2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@iii-i iii-i mentioned this pull request Jan 3, 2023
@Dead2 Dead2 merged commit 2ff9398 into zlib-ng:develop Jan 9, 2023
Dead2 added a commit that referenced this pull request Mar 7, 2023
Changes since 2.0.6:
- Fix CVE-2022-37434 #1328
- Fix chunkmemset #1196
- Fix deflateBound too small #1236
- Fix Z_SOLO #1263
- Fix ACLE variant of crc32 #1274
- Fix inflateBack #1311
- Fix deflate_quick windowsize #1431
- Fix DFLTCC bugs related to adler32 #1349 and #1390
- Fix warnings #1194 #1312 #1362
- MacOS build fix #1198
- Add invalid windowBits handling #1293
- Support for Force TZCNT #1186
- Support for aligned_alloc() #1360
- Minideflate improvements #1175 #1238
- Dont use unaligned access for memcpy #1309
- Build system #1209 #1233 #1267 #1273 #1278 #1292 #1316 #1318 #1365
- Test improvements #1208 #1227 #1241 #1353
- Cleanup #1266
- Documentation #1205 #1359
- Misc improvements #1294 #1297 #1306 #1344 #1348
- Backported zlib fixes
- Backported CI workflows from Develop branch
Dead2 added a commit that referenced this pull request Mar 17, 2023
Changes since 2.0.6:
- Fix CVE-2022-37434 #1328
- Fix chunkmemset #1196
- Fix deflateBound too small #1236
- Fix Z_SOLO #1263
- Fix ACLE variant of crc32 #1274
- Fix inflateBack #1311
- Fix deflate_quick windowsize #1431
- Fix DFLTCC bugs related to adler32 #1349 and #1390
- Fix warnings #1194 #1312 #1362
- MacOS build fix #1198
- Add invalid windowBits handling #1293
- Support for Force TZCNT #1186
- Support for aligned_alloc() #1360
- Minideflate improvements #1175 #1238
- Dont use unaligned access for memcpy #1309
- Build system #1209 #1233 #1267 #1273 #1278 #1292 #1316 #1318 #1365
- Test improvements #1208 #1227 #1241 #1353
- Cleanup #1266
- Documentation #1205 #1359
- Misc improvements #1294 #1297 #1306 #1344 #1348
- Backported zlib fixes
- Backported CI workflows from Develop branch
@iii-i iii-i deleted the dfltcc-strm-adler-raw branch July 5, 2023 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants