Repository navigation
arm64: fix base64 default_or_url tables accepting '[' - #1062
Merged
Merged
Conversation
In to_base64_mask, the default_or_url tables gave '+' and '_' the same bit, so '[' (lut_lo[0xB] & lut_hi[0xB] = 0xa2 & 0x12) was taken for a base64 character. The scalar tables reject it. With base64_default_or_url, '[' was decoded instead of reported as INVALID_BASE64_CHARACTER; with base64_default_or_url_accept_garbage, it was not skipped. '_' now uses bit 0x10 (lut_lo[0xF] = 0xb6, lut_hi[0xB] = 0x10). Reported-by: Dylan Conway <[email protected]>
dylan-conway
pushed a commit
to oven-sh/WebKit
that referenced
this pull request
Oct 28, 2026
simdutf fixed this in 23556f1 (simdutf/simdutf#1062, released in v9.3.3). This replaces our own fix with theirs, so that the imported file differs from v9.0.0 only by what a newer import brings anyway. Upstream gives '_' a bit of its own instead of '+': lut_lo[0xF] = 0xb6 and lut_hi[0xB] = 0x10 in the default_or_url tables. It also corrects the Visual Studio spelling of the base64_url lut_hi, which had 0x6 where the other spelling has 0x4. Our change of lut_lo[0xB], the comments, the lower bound of the walk back and the TestWTF test go. The arm64 base64 section of the file is now byte for byte v9.0.0's arm_base64.cpp with 23556f1 applied. * Source/WTF/wtf/simdutf/simdutf_impl.cpp.h: (simdutf::arm64::to_base64_mask): (simdutf::arm64::compress_decode_base64): (simdutf::haswell::base64::compress_decode_base64): (simdutf::westmere::base64::compress_decode_base64): * Tools/TestWebKitAPI/Tests/WTF/Base64.cpp:
7 of 23 tasks
7 of 23 tasks
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.
On arm64, the base64 decoder took '[' (0x5B) for a base64 character with
base64_default_or_urlandbase64_default_or_url_accept_garbage. Into_base64_mask, the default_or_url tables gave '+' and '_' the same bit, so '[' passed as well (lut_lo[0xB] & lut_hi[0xB] = 0xa2 & 0x12 = 0x02). The scalar table rejects it.Consequences:
base64_default_or_url: '[' was decoded instead of reported asINVALID_BASE64_CHARACTER.base64_default_or_url_accept_garbage: '[' was not skipped.Fix: '_' now uses bit 0x10, which only X/Y/Z share in that row (
lut_lo[0xF] = 0xb6,lut_hi[0xB] = 0x10).Reported by Dylan Conway (@dylan-conway, Bun), who found the cause and provided a reproducer.