Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compress/flate: deflatefast produces corrupted output [1.15 backport] #41463

Closed
gopherbot opened this issue Sep 17, 2020 · 3 comments
Closed
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge release-blocker
Milestone

Comments

@gopherbot
Copy link

@ianlancetaylor requested issue #41420 to be considered for backport to the next 1.15 minor release.

@gopherbot please open a backport issue for Go 1.15.

The compress/flate package can produce corrupt output. There is no workaround.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Sep 17, 2020
@gopherbot gopherbot added this to the Go1.15.3 milestone Sep 17, 2020
@dmitshur
Copy link
Contributor

dmitshur commented Oct 8, 2020

Approving per discussion in a release meeting. This is a serious issue without a workaround. Only Go 1.15 needs this backport.

@dmitshur dmitshur added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Oct 8, 2020
@dmitshur dmitshur changed the title compress/zlib: compression behavior change since go1.15? [1.15 backport] compress/flate: deflatefast produces corrupted output [1.15 backport] Oct 8, 2020
@toothrot toothrot modified the milestones: Go1.15.3, Go1.15.4 Oct 14, 2020
@gopherbot
Copy link
Author

Change https://golang.org/cl/266177 mentions this issue: [release-branch.go1.15] compress/flate: fix corrupted output

@gopherbot
Copy link
Author

Closed by merging 777e455 to release-branch.go1.15.

gopherbot pushed a commit that referenced this issue Oct 29, 2020
The fastest compression mode can pick up a false match for every 2GB
of input data resulting in incorrectly decompressed data.

Since matches are allowed to be up to and including at maxMatchOffset
we must offset the buffer by an additional element to prevent the first
4 bytes to match after an out-of-reach value after shiftOffsets has
been called.

We offset by `maxMatchOffset + 1` so offset 0 in the table will now
fail the `if offset > maxMatchOffset` in all cases.

Updates #41420.
Fixes #41463.

Change-Id: If1fbe01728e132b8a207e3f3f439edd832dcc710
GitHub-Last-Rev: 50fabab
GitHub-Pull-Request: #41477
Reviewed-on: https://go-review.googlesource.com/c/go/+/255879
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Joe Tsai <thebrokentoaster@gmail.com>
Trust: Matthew Dempsky <mdempsky@google.com>
(cherry picked from commit ab541a0)
Reviewed-on: https://go-review.googlesource.com/c/go/+/266177
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
@golang golang locked and limited conversation to collaborators Oct 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge release-blocker
Projects
None yet
Development

No branches or pull requests

3 participants