Repository navigation
fix(android-ota): require complete REPLACE_ZSTD input consumption - #12383
ShuaixinHuang wants to merge 2 commits into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] This PR appears safe to merge; no blocking issues were found. SummaryThis PR rejects
No actionable issues found. A direct Node.js check confirmed that the appended byte remains unread while valid compressed input is fully consumed. Reviews (2) · Last reviewed commit: "Merge branch 'main' into fix/android-ota..." · Reviewed by Greptile |
|
Thanks for this. Unread trailing bytes in a REPLACE_ZSTD operation are a real gap. One thing to change before this can land: |
|
Superseded by #12416, now merged into main. Android OTA REPLACE_ZSTD now uses the shared exact-frame reader. Its regression rejects unread input while retaining valid concatenated frames, and the consumption check applies independently of the operation hash. Thanks for identifying the OTA case. |
Summary
An Android OTA REPLACE_ZSTD operation can contain a byte beyond the compressed frame. On main reconstruction succeeded despite not consuming that byte. Both the operation digest and the partition digest matched the values declared in the fixture, since they cover different inputs.
Change and scope
Compare the decompressor's consumed byte count with the admitted operation data length before writing destination extents. Report a malformed operation when encoded bytes remain. Keep the existing output ceiling and digest checks. No separate issue was filed.
Contract and boundary impact
Android OTA partition reconstruction. Changes the result for a malformed REPLACE_ZSTD input and preserves valid reconstruction and coverage semantics. This PR fits the existing scope. No new provider, target execution, product packaging, or installation behavior is introduced.
Evidence and regression coverage
The new fixture reconstructs successfully on main and fails as malformed after the patch. The existing valid REPLACE_ZSTD control still reconstructs the expected bytes. Inputs are synthetic. No vendor OTA payload or separate CLI run was exercised.
Validation performed
3fdda4e1aand passed with the fix.npm run check:fastpassed. The push hook was bypassed and the check was run separately because workspace disk space was limited.git diff --checkpassed for this branch.Author readiness
Human owner: @ShuaixinHuang
Before merge
type(scope): outcome.