Repository navigation
UPSTREAM: Detect and report invalid stream earlier. - #13940
Merged
Merged
Conversation
Contributor
|
Contributor
🤖 Gemini Suggested Commit Message💡 Pro Tips for a Better Commit Message:
|
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the Brotli decoder's block switch decoding logic to return explicit BrotliDecoderErrorCode statuses instead of simple boolean values. This includes introducing a new error code BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH (value -17) and a new helper macro BROTLI_SAFE_WITH_STATUS to handle and propagate these statuses during command processing. There are no review comments, and I have no feedback to provide.
jellefoks
approved these changes
Nov 11, 2026
jshorta
force-pushed
the
brotli-cve-2026-111497
branch
from
November 11, 2026 21:09
de929c9 to
ccf3958
Compare
yell0wd0g
enabled auto-merge (squash)
November 11, 2026 21:09
jshorta
force-pushed
the
brotli-cve-2026-111497
branch
from
November 11, 2026 21:58
ccf3958 to
4c52394
Compare
jshorta
force-pushed
the
brotli-cve-2026-111497
branch
from
November 11, 2026 22:42
4c52394 to
612f1a3
Compare
jshorta
force-pushed
the
brotli-cve-2026-111497
branch
from
November 11, 2026 23:39
612f1a3 to
a88b310
Compare
This was referenced Nov 12, 2026
cobalt-roller-and-merger Bot
pushed a commit
that referenced
this pull request
Nov 13, 2026
…lier. Refer to original PR: #13940 Detect and report invalid stream earlier. PiperOrigin-RevId: 876198329 (am from google/brotli@0ed4268) Import an upstream fix for invalid block-switch handling in the Brotli decoder (CVE-2026-111497). This update refactors block-type decoding functions to return explicit error codes, allowing the decoder to identify and report malformed streams earlier in the process. Bug: 578287425 (cherry picked from commit f110dc6)
jshorta
added a commit
that referenced
this pull request
Nov 17, 2026
…lier. (#13952) Refer to the original PR: #13940 Detect and report invalid stream earlier. PiperOrigin-RevId: 876198329 (am from google/brotli@0ed4268) Import an upstream fix for invalid block-switch handling in the Brotli decoder (CVE-2026-111497). This update refactors block-type decoding functions to return explicit error codes, allowing the decoder to identify and report malformed streams earlier in the process. Bug: 578287425 Bug: 580961451 Co-authored-by: Jesus Horta <jshorta@google.com>
jshorta
added a commit
that referenced
this pull request
Nov 19, 2026
…lier. (#13953) Refer to the original PR: #13940 Detect and report invalid stream earlier. PiperOrigin-RevId: 876198329 (am from google/brotli@0ed4268) Import an upstream fix for invalid block-switch handling in the Brotli decoder (CVE-2026-111497). This update refactors block-type decoding functions to return explicit error codes, allowing the decoder to identify and report malformed streams earlier in the process. Bug: 578287425 Bug: 580961451 Co-authored-by: Jesus Horta <jshorta@google.com>
andrewsavage1
pushed a commit
that referenced
this pull request
Nov 25, 2026
… stream earlier. Refer to original PR: #13940 Detect and report invalid stream earlier. PiperOrigin-RevId: 876198329 (am from google/brotli@0ed4268) Import an upstream fix for invalid block-switch handling in the Brotli decoder (CVE-2026-111497). This update refactors block-type decoding functions to return explicit error codes, allowing the decoder to identify and report malformed streams earlier in the process. Bug: 578287425 (cherry picked from commit f110dc6)
andrewsavage1
added a commit
that referenced
this pull request
Nov 25, 2026
…tream earlier. Staging's brotli (updated to 150.x) already contains upstream 0ed4268 (BLOCK_SWITCH error code, BROTLI_SAFE_WITH_STATUS, error-returning block-switch decoders) in its newer form using the NextLiteralBlock label. Resolved both conflicts in dec/decode.c by keeping staging's code. Kept the only remaining delta: SafeDecodeDistanceBlockSwitch now returns BrotliDecoderErrorCode instead of BROTLI_BOOL. decode.h needs no change (BLOCK_SWITCH -17 already present).
andrewsavage1
added a commit
that referenced
this pull request
Nov 25, 2026
… stream earlier. (#14263) Refer to original PR: #13940 Detect and report invalid stream earlier. PiperOrigin-RevId: 876198329 (am from google/brotli@0ed4268) Import an upstream fix for invalid block-switch handling in the Brotli decoder (CVE-2026-111497). This update refactors block-type decoding functions to return explicit error codes, allowing the decoder to identify and report malformed streams earlier in the process. Bug: 578287425 (cherry picked from commit f110dc6) --- **Resolution** (commit `0a78938f53c`, against `autoroll-main-to-staging` @ `0c2033df69f`): third_party/brotli/dec/decode.c: Staging's brotli (rolled to 150.x) already has upstream fix 0ed4268, written in its newer form that jumps to a shared `NextLiteralBlock:` label and calls BROTLI_SAFE_WITH_STATUS(DecodeLiteralBlockSwitch(s)). Both conflicts were resolved by keeping staging's code. One change was still missing, so I kept it: SafeDecodeDistanceBlockSwitch now returns BrotliDecoderErrorCode instead of BROTLI_BOOL. third_party/brotli/include/brotli/decode.h: no change needed, because BLOCK_SWITCH (-17) is already there on staging. No conflict markers are left. **Notes:** The fix is essentially already on staging, so the net change is a single return-type line. Since BROTLI_BOOL is an int, the old code already passed the value through correctly, so behaviour doesn't change; the line only fixes the type. Applying the commit is harmless, but skipping the PR would also be fine. No build was run. Not compiled locally; CI on the roll PR is the first build. --------- Co-authored-by: Jesus Horta <jshorta@google.com> Co-authored-by: Andrew Savage <andrewsavage@google.com>
cobalt-roller-and-merger Bot
pushed a commit
that referenced
this pull request
Nov 25, 2026
… stream earlier. (#14263) Refer to original PR: #13940 Detect and report invalid stream earlier. PiperOrigin-RevId: 876198329 (am from google/brotli@0ed4268) Import an upstream fix for invalid block-switch handling in the Brotli decoder (CVE-2026-111497). This update refactors block-type decoding functions to return explicit error codes, allowing the decoder to identify and report malformed streams earlier in the process. Bug: 578287425 (cherry picked from commit f110dc6) --- **Resolution** (commit `0a78938f53c`, against `autoroll-main-to-staging` @ `0c2033df69f`): third_party/brotli/dec/decode.c: Staging's brotli (rolled to 150.x) already has upstream fix 0ed4268, written in its newer form that jumps to a shared `NextLiteralBlock:` label and calls BROTLI_SAFE_WITH_STATUS(DecodeLiteralBlockSwitch(s)). Both conflicts were resolved by keeping staging's code. One change was still missing, so I kept it: SafeDecodeDistanceBlockSwitch now returns BrotliDecoderErrorCode instead of BROTLI_BOOL. third_party/brotli/include/brotli/decode.h: no change needed, because BLOCK_SWITCH (-17) is already there on staging. No conflict markers are left. **Notes:** The fix is essentially already on staging, so the net change is a single return-type line. Since BROTLI_BOOL is an int, the old code already passed the value through correctly, so behaviour doesn't change; the line only fixes the type. Applying the commit is harmless, but skipping the PR would also be fine. No build was run. Not compiled locally; CI on the roll PR is the first build. --------- Co-authored-by: Jesus Horta <jshorta@google.com> Co-authored-by: Andrew Savage <andrewsavage@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Detect and report invalid stream earlier.
PiperOrigin-RevId: 876198329
(am from google/brotli@0ed4268)
Import an upstream fix for invalid block-switch handling in the Brotli
decoder (CVE-2026-111497). This update refactors block-type
decoding functions to return explicit error codes, allowing the
decoder to identify and report malformed streams earlier in the
process.
Bug: 578287425
Bug: 580961451