Incorrect AliasSet for MLoadTypedArrayElementHole
Categories
(Core :: JavaScript Engine: JIT, defect, P2)
Tracking
()
People
(Reporter: lukas.bernhard, Assigned: lukas.bernhard)
References
(Blocks 2 open bugs, Regression)
Details
(Keywords: sec-moderate, Whiteboard: [post-critsmash-triage][adv-main99+][adv-esr91.8+])
Attachments
(2 files)
48 bytes,
text/x-phabricator-request
|
dmeehan
:
approval-mozilla-beta+
RyanVM
:
approval-mozilla-esr91+
|
Details | Review |
270 bytes,
text/plain
|
Details |
Steps to reproduce:
The AliasSet of MLoadTypedArrayElementHole is currently set to AliasSet::Load(AliasSet::UnboxedElement). When lowered to either LLoadTypedArrayElementHole or LLoadTypedArrayElementHoleBigInt and eventually codegened, there is a masm.loadArrayBufferViewLengthIntPtr(...). Therefore, AliasSet::ArrayBufferViewLengthOrOffset should be added to the AliasSet. Furthermore, there is an access to ArrayBufferViewObject::dataOffset(). Therefore, AliasSet::ObjectFields should be added as well.
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 1•3 years ago
|
||
Sounds like the analysis in comment 0 is correct, from what I understand.
This should also be an easy patch to add it to MLoadTypedArrayElementHole::getAliasSet
Lukas, if you are interested in contributing a patch as well, to have a patch in firefox in addition to having found the issue ;)
Otherwise, any of us can take make the patch.
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
Updated•3 years ago
|
Comment 3•3 years ago
|
||
Setting security rating to sec-moderate, as there is no AliasSet with Store(ArrayBufferViewLengthOrOffset)
. Not having any of this kind implies that any mutation to the length would have to be done through a call which has a Store(Any)
.
The other missing AliasSet with Store(ObjectFields)
, is about the manipulation of a reserved DATA_SLOT
slot. The only MIR instruction which might manipulate typed arrays, would be a MMegamorphicStoreSlot
, but reserved slot do not have names associated to them.
Thus, this bug does not sounds actionable on its own, but is definitely not correct and could be used with another issue as a way to do random memory read.
Updated•3 years ago
|
Assignee | ||
Comment 4•3 years ago
|
||
Bug 829896 changed the AliasSet from AliasSet::Store(AliasSet::Any) to AliasSet::Load(AliasSet::TypedArrayElement)
, CodeGenerator.cpp already accessed dataOffset()
at this point.
![]() |
||
Comment 5•3 years ago
|
||
Fix AliasSet of MLoadTypedArrayElementHole - r=nbp
https://hg.mozilla.org/integration/autoland/rev/d4ffb09f40d5b78e04e5ff6cafead2f0da27f594
https://hg.mozilla.org/mozilla-central/rev/d4ffb09f40d5
Updated•3 years ago
|
Comment 6•3 years ago
|
||
Nice find, Lukas! Please request Beta and ESR91 approval on this when you get a chance.
Updated•3 years ago
|
Assignee | ||
Comment 7•3 years ago
|
||
Comment on attachment 9265934 [details]
Bug 1756957 - Fix AliasSet of MLoadTypedArrayElementHole - r=nbp
Beta/Release Uplift Approval Request
- User impact if declined: In combination with another issue, this bug could serve as a stepping stone for arbitrary memory reads.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Unlikely to cause regressions, it just falls back on more conservative assumptions.
- String changes made/needed: N/A
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: In combination with another issue, this bug could serve as a stepping stone for arbitrary memory reads. It hence is more of a defense-in-depth request than directly affecting user security.
- User impact if declined: Weakening robustness of the the JS engine in the presence of another flaw.
- Fix Landed on Version: 100
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Unlikely to cause regressions, it just falls back on more conservative assumptions.
Comment 8•3 years ago
|
||
Comment on attachment 9265934 [details]
Bug 1756957 - Fix AliasSet of MLoadTypedArrayElementHole - r=nbp
Approved for 99.0b5. Thanks.
Comment 9•3 years ago
|
||
uplift |
Comment 10•3 years ago
|
||
Comment on attachment 9265934 [details]
Bug 1756957 - Fix AliasSet of MLoadTypedArrayElementHole - r=nbp
Approved for 91.8esr.
Comment 11•3 years ago
|
||
uplift |
Updated•3 years ago
|
Comment 12•3 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Description
•