Skip to content
Snippets Groups Projects
  1. Aug 04, 2020
    • Hans Wennborg's avatar
      [zlib] Add streaming inflate fuzzer · 493d4299
      Hans Wennborg authored
      This adds a new fuzzer which first deflates and then inflates some data
      one chunk at a time and verifies that it round-trips correctly. It's
      targeted at the recent bug where inffast_chunk was called with
      overlapping from and out buffers.
      
      I've verified that the fuzzer detects the incorrect inflate results when
      using Clang's -basic-aa-recphi option before the bug fix in e0f88a9.
      
      Furthermore, this patch adds asserts in inffast_chunk and other
      functions that verify there's no overlap of restrict-qualified buffers.
      (I've checked that the fuzzer hits the inffast_chunk assert before
      e0f88a9).
      
      To make those asserts work, this changes the build config to define
      ZLIB_DEBUG in debug and fuzzer builds.
      
      Bug: 1103818, 708726
      Change-Id: Ia3d5e7906b8b1a65d56a589d8a81d17661e638c2
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2332705
      
      
      Commit-Queue: Hans Wennborg <hans@chromium.org>
      Reviewed-by: default avatarNico Weber <thakis@chromium.org>
      Reviewed-by: default avatarAdenilson Cavalcanti <cavalcantii@chromium.org>
      Cr-Original-Commit-Position: refs/heads/master@{#794482}
      Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
      Cr-Mirrored-Commit: 3eda17e22e6a3c4e44fdfa778b7d55f0a7c82e75
      493d4299
  2. Jul 30, 2020
    • Adenilson Cavalcanti's avatar
      Handling undefined behavior in inffast_chunk · a21a4e8f
      Adenilson Cavalcanti authored
      It was revealed by a new clang flag (i.e. basic-aa-recphi) that chunkcopy_safe
      could hit a scenario of undefined behavior with the use of 'restrict' modifier when
      the 'from' and 'out' pointers overlapped during decompression.
      
      This patch targets to address this issue and unblock the enablement of the
      aforementioned compiler flag.
      
      Credit for the original investigation and the new unit test stressing the
      failure scenario goes to Hans Wennborg.
      
      Performance implications: initial numbers point to
      a slight improvement for ARM big cores@64bit (i.e. 2% to 3.6%) and x86-64
      (i.e. up to 7.5% for Intel i7) but a regression otherwise for 32bit
      (i.e. between 2.3% to 3% big.LITTLE respectively).
      
      Bug: 1103818
      Change-Id: I9b7d2c1e47caaf498cd539fd6b77c4b949cb0dac
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2309041
      
      
      Reviewed-by: default avatarHans Wennborg <hans@chromium.org>
      Reviewed-by: default avatarAdenilson Cavalcanti <cavalcantii@chromium.org>
      Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
      Cr-Original-Commit-Position: refs/heads/master@{#793239}
      Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
      Cr-Mirrored-Commit: e0f88a903fdcb6c772de1929834a73d1662d509a
      a21a4e8f
  3. Jul 29, 2020
  4. Jul 27, 2020
  5. Jul 06, 2020
  6. Jun 28, 2020
  7. Jun 24, 2020
  8. Jun 19, 2020
  9. Jun 12, 2020
  10. Jun 03, 2020
  11. Jun 02, 2020
  12. May 26, 2020
  13. May 21, 2020
  14. May 19, 2020
  15. May 12, 2020
  16. May 08, 2020
  17. Apr 30, 2020
  18. Apr 29, 2020
    • Noel Gordon's avatar
      [zlib] Fix gcc parenthesis warning in crc_folding.c from V8 roll · 438cb5c0
      Noel Gordon authored
      V8 roll uses gcc and [-Werror=parentheses], and started reporting code
      errors in crc_folding.c recently, issue 1076360
      
        third_party/zlib/crc_folding.c:288:19: error: suggest parentheses
        around ‘-’ in operand of ‘&’ [-Werror=parentheses]
        288 |     algn_diff = 0 - (uintptr_t)src & 0xF;
            |                 ~~^~~~~~~~~~~~~~~~
        cc1: all warnings being treated as errors
      
      Operator - has higher precedence than &, per C rules but help gcc work
      out that that is the code intent by bracketing the expression:
      
        algn_diff = (0 - (uintptr_t)src) & 0xF;
      
      [-Werror=parentheses] is happy with that change, and so is zlib_bench,
      at zlib@1,3,6,9. No change in behavior: covered by many, many existing
      integration, unit and blink layout tests.
      
      Tbr: cblume, cavalcantii
      Bug: 1076360, 1072308
      Change-Id: Id9411dc96b638ca44ca9c67f6c411bf7c4bec519
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2172191
      
      
      Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
      Reviewed-by: default avatarMichael Achenbach <machenbach@chromium.org>
      Commit-Queue: Noel Gordon <noel@chromium.org>
      Cr-Original-Commit-Position: refs/heads/master@{#763787}
      Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
      Cr-Mirrored-Commit: 7453f9f2d7adcdb5c30aa9d802d0a19d6c085bb7
      438cb5c0
    • Adenilson Cavalcanti's avatar
      [zlib] Re-land import canonical zlib inflate cover tests · 699e86dc
      Adenilson Cavalcanti authored
      There is a test suite in Canonical zlib that ensures correctness and
      coverage of inflate/deflate: the inflate cover (infcover.c) suite.
      
      This patch imports the inflate cover suite with the necessary changes
      to make it build and run under Chromes's C++11 GTEST test system.
      
      There are minimal changes (i.e. undefined 'local', miscellaneous C
      casts to use C++ casts, etc) so we can build it as C++ code and hook
      into GTEST e.g. use EXPECT_TRUE instead of C assert from <assert.h>.
      
      Adds a patch file for these changes, that can be applied on Canonical
      infcover should we need to sync with a new Canonical zlib release.
      
      TODO: there's one test accessing a symbol that causes link errors so
      comment that code out for now.
      
      Bug: 1032721
      Change-Id: I004a1357d46d909ad3a5a5bacc5f9ab9bfcb7809
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2168792
      
      
      Reviewed-by: default avatarAdenilson Cavalcanti <cavalcantii@chromium.org>
      Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
      Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
      Cr-Original-Commit-Position: refs/heads/master@{#763696}
      Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
      Cr-Mirrored-Commit: 26b3182d7a40f33da10a95bc69199af925dedbcc
      699e86dc
  19. Apr 23, 2020
  20. Apr 22, 2020
  21. Apr 21, 2020
  22. Apr 20, 2020
  23. Apr 17, 2020
  24. Apr 15, 2020
  25. Apr 14, 2020
Loading