Closed
Bug 1517823
Opened 5 years ago
Closed 5 years ago
Store out of line TypedArray data in ArrayBufferContentsArena?
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla66
Tracking | Status | |
---|---|---|
firefox66 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
Details
Attachments
(2 files)
7.05 KB,
patch
|
sfink
:
review+
|
Details | Diff | Splinter Review |
12.99 KB,
patch
|
sfink
:
review+
|
Details | Diff | Splinter Review |
bug 1052582 changed ArrayBuffers to use a separate arena for the ArrayBuffer contents, but no similar changed happened for TypedArray. bug 1052582, comment #18 mentions: > Allocating out of line ArrayBuffer data in a separate heap region *does* seem like a large security win to me, [...] Doesn't this also apply for out of line TypedArray data [1,2]? [1] https://searchfox.org/mozilla-central/rev/fef7f858efb695a76010b4c624da5277c16e95b3/js/src/jit/MacroAssembler.cpp#1194 [2] https://searchfox.org/mozilla-central/rev/fef7f858efb695a76010b4c624da5277c16e95b3/js/src/vm/TypedArrayObject.cpp#215
Assignee | ||
Comment 1•5 years ago
|
||
We also ignore the requested arena_t in MallocProvider when we call onOutOfMemory. Which in turn means it's possible to create an ArrayBuffer in the js::MallocArena instead of the js::ArrayBufferContentsArena in near OOM situations.
Assignee: nobody → andrebargull
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•5 years ago
|
||
Changes the inlined TypedArray constructor to use |js::ArrayBufferContentsArena| instead of |js::MallocArena| for its data. This should fix the issue noted in comment #0. Applies on top of bug 1518101 and bug 1517259.
Attachment #9034718 -
Flags: review?(sphink)
Assignee | ||
Comment 3•5 years ago
|
||
When retrying an allocation after near OOM situations, the previously requested arena should be used again. Otherwise it's possible to create an ArrayBuffer/TypedArray whose data is in the normal js::MallocArena instead of js::ArrayBufferContentsArena.
Attachment #9034719 -
Flags: review?(sphink)
Comment 4•5 years ago
|
||
Comment on attachment 9034718 [details] [diff] [review] bug1517823-part1-typedarray-data-arena.patch Review of attachment 9034718 [details] [diff] [review]: ----------------------------------------------------------------- Nice catch.
Attachment #9034718 -
Flags: review?(sphink) → review+
Comment 5•5 years ago
|
||
Comment on attachment 9034719 [details] [diff] [review] bug1517823-part2-requested-arena-on-retry-alloc.patch Review of attachment 9034719 [details] [diff] [review]: ----------------------------------------------------------------- Ouch. Thanks for the cleanup.
Attachment #9034719 -
Flags: review?(sphink) → review+
Assignee | ||
Comment 6•5 years ago
|
||
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=22537cf2fd00e4af6132abd7a05827c37bd79eda
Keywords: checkin-needed
Pushed by dluca@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3d09512072a5
Part 1: Store out of line TypedArray data in ArrayBuffer malloc-arena. r=sfink
https://hg.mozilla.org/integration/mozilla-inbound/rev/752c683e631d
Part 2: Pass arena to MallocProvider client. r=sfink
Keywords: checkin-needed
Comment 8•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3d09512072a5
https://hg.mozilla.org/mozilla-central/rev/752c683e631d
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in
before you can comment on or make changes to this bug.
Description
•