Conversation
…tic shift i32x4_shr performs an arithmetic shift which extends the sign bit into the portion that is then or'd with the rest of the rotate; if the encoded high bit is 1, the output may be decoded incorrectly.
This incorporates the fix to Wasm32 rotate decoding.
Previously our tests did not include cases where the encoded values have most significant bit of 1; this masked the bug in Wasm32 rotate decoding which could happen in rare circumstances. Note that this only affects Wasm and only affects cases where encoded data uses version 1 and level 3, as xor isn't used in other cases.
Owner
Author
|
This was introduced in v0.23, a little over a year ago, and appears to be difficult to hit naturally. The issue was discovered using LLM driven static analysis - not on real data. Unfortunately, it was right after the 1.1 release, so the fix obviously didn't make it. The scope here is limited but the timeline until 1.2 is quite long (many months). I'm considering a patch (1.1.1) release that, to reduce the release burden and minimize churn, would be scoped to meshoptimizer NPM package. This would be similar to 1.0.1 release that was also NPM only, although that one had no C++ changes. |
Owner
Author
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.
i32x4_shr performs an arithmetic shift which extends the sign bit into
the portion that is then or'd with the rest of the rotate; if the
encoded high bit is 1, the output may be decoded incorrectly.
Note that this only affects Wasm and only affects cases where encoded
data uses version 1 and level 3, as xor isn't used in other cases. This
also appears to be difficult to hit on real content; the added test is synthetic.