Closed Bug 2013993 Opened 9 months ago Closed 5 months ago

src/js/src/vm/Iteration.cpp:914:32: runtime error: constructor call on misaligned address 0x561f58fe951c for type 'GCPtr<Shape *>', which requires 8 byte alignment

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

RESOLVED FIXED
153 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox149 --- wontfix
firefox151 --- wontfix
firefox152 --- wontfix
firefox153 --- fixed

People

(Reporter: tsmith, Assigned: alexical)

References

(Blocks 2 open bugs)

Details

(Keywords: csectype-undefined, sec-moderate, Whiteboard: [adv-main153+r])

Attachments

(1 external file)

This was found by enabling the alignment check in UBSan. This type of issue can impact performance, stability and create inconsistencies across platforms, architectures and optimization levels.

This issue is trigger on browser startup. Found with m-c 20260202-1db5c98531ac.

To enable this check add the following to your mozconfig:

ac_add_options --enable-undefined-sanitizer="alignment"
src/js/src/vm/Iteration.cpp:914:32: runtime error: constructor call on misaligned address 0x561f58fe951c for type 'GCPtr<Shape *>', which requires 8 byte alignment
0x561f58fe951c: note: pointer points here
  88 45 00 00 8e 45 00 00  8f 45 00 00 97 45 00 00  81 06 00 00 00 00 00 00  e0 5c c5 0d 82 7f 00 00
              ^
    #0 0x7f8201ae9d79 in js::NativeIterator::NativeIterator(JSContext*, JS::Handle<js::PropertyIteratorObject*>, JS::Handle<JSObject*>, JS::Handle<JS::StackGCVector<JS::PropertyKey, js::TempAllocPolicy>>, bool, mozilla::Vector<js::PropertyIndex, 8ul, js::TempAllocPolicy>*, unsigned int, unsigned int, bool, bool*) src/js/src/vm/Iteration.cpp:914:9
    #1 0x7f8201aed51d in CreatePropertyIterator(JSContext*, JS::Handle<JSObject*>, JS::Handle<JS::StackGCVector<JS::PropertyKey, js::TempAllocPolicy>>, bool, mozilla::Vector<js::PropertyIndex, 8ul, js::TempAllocPolicy>*, unsigned int, unsigned int, bool) src/js/src/vm/Iteration.cpp:832:13
    #2 0x7f8201aeac77 in GetIteratorImpl(JSContext*, JS::Handle<JSObject*>, bool, bool) src/js/src/vm/Iteration.cpp:1283:37
    #3 0x0cbe72e067da  (<unknown module>)

SUMMARY: UndefinedBehaviorSanitizer: misaligned-pointer-use src/js/src/vm/Iteration.cpp:914:32
Blocks: sm-testing
Severity: -- → S3
Priority: -- → P3

Looks to be this line new (protoShapesEnd()) GCPtr<Shape*>(shape);

Which makes me wonder if this code https://searchfox.org/firefox-main/source/js/src/vm/Iteration.h#349-360 isn't aligning properly.

See Also: → 2042717
Group: javascript-core-security
Keywords: sec-moderate

Alex, can you take a look at this?

Flags: needinfo?(dothayer)
Assignee: nobody → dothayer
Flags: needinfo?(dothayer)
Attached file (secure) —
Group: javascript-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch
QA Whiteboard: [sec] [qa-triage-done-c154/b153]
Duplicate of this bug: 2042717
Whiteboard: [adv-main153+r]
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: