Closed Bug 1681308 Opened 3 years ago Closed 3 years ago

Add alignment requirement for TranscodeRange and TranscodeBuffer

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(1 file)

To directly use XDR buffer from decoded stencil data, buffer+cursor and range passed to the following should align to 4 bytes:

  • DecodeOffThreadScript
  • EncodeScript
  • DecodeScript
  • DecodeScriptMaybeStencil
  • DecodeScriptAndStartIncrementalEncoding
  • FinishIncrementalEncoding

currently ScriptLoader has 5 bytes or some data summary at the beginning of buffer
https://searchfox.org/mozilla-central/rev/ffdb6a4d934b3f5294f18cf0e1df618109ccb36b/dom/security/SRICheck.cpp#346-392

to align 32-bit, the consumer of transcoding API should add padding after that.

(In reply to Tooru Fujisawa [:arai] from comment #1)

currently ScriptLoader has 5 bytes or some data summary at the beginning of buffer
https://searchfox.org/mozilla-central/rev/ffdb6a4d934b3f5294f18cf0e1df618109ccb36b/dom/security/SRICheck.cpp#346-392

Note, It has more than 5 bytes, it also contains the hash payload which size depends on the last script tag which recorded it.

Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/38a29b24d611
Add alignment requirement to XDR buffer. r=nbp
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: