dom::SRICheckDataVerifier::ExportEmptyDataSummary alignement issue

RESOLVED FIXED in Firefox 58

Status

()

Core
DOM: Security
P2
normal
RESOLVED FIXED
4 months ago
3 months ago

People

(Reporter: Martin Husemann, Assigned: nbp)

Tracking

55 Branch
mozilla58
Points:
---

Firefox Tracking Flags

(firefox58 fixed)

Details

(Whiteboard: [domsecurity-active])

Attachments

(1 attachment)

(Reporter)

Description

4 months ago
When trying to start firefox 55 on sparc64 I get:

Thread 1 received signal SIGBUS, Bus error.
mozilla::dom::SRICheckDataVerifier::ExportEmptyDataSummary (aDataLen=<optimized out>, aData=0x564d0b58 "")
    at /usr/pkgobj/www/firefox/work/firefox-55.0.3/dom/security/SRICheck.cpp:535
535       *reinterpret_cast<decltype(mHashLength)*>(&aData[offset]) = 0;

A *reinterpret_cast<> on the LHS of an assignement almost never is a good idea, as it tricks the compiler to assume proper alignment, which in this case is not guaranteed.

A simple temporary var, assign to that and memcpy() is the easy fix.
Component: DOM → DOM: Security
Hey :francois, :nbp; any chance we can clean up all of those reinterpret casts within SRICheck.cpp? Could anyone of you take on that work?
Blocks: 1288104
Flags: needinfo?(nicolas.b.pierron)
Flags: needinfo?(francois)
Priority: -- → P2
Whiteboard: [domsecurity-active]
(Assignee)

Comment 2

4 months ago
I will look at it, in the mean time you can simply remove the only call to this function as it is made for a feature which is not enabled at the moment, but soon will be.
(Assignee)

Comment 3

4 months ago
Created attachment 8914828 [details] [diff] [review]
Use memcpy to import/export SRI hashes to the JS bytecode buffer.
Attachment #8914828 - Flags: review?(francois)
(Assignee)

Updated

4 months ago
Flags: needinfo?(nicolas.b.pierron)
Attachment #8914828 - Flags: review?(francois) → review+
Assignee: nobody → nicolas.b.pierron
Status: NEW → ASSIGNED
Flags: needinfo?(francois)

Comment 5

3 months ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1fec7f1ae11e
Use memcpy to import/export SRI hashes to the JS bytecode buffer. r=francois
Keywords: checkin-needed

Comment 6

3 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/1fec7f1ae11e
Status: ASSIGNED → RESOLVED
Last Resolved: 3 months ago
status-firefox58: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.