Closed
Bug 1268083
Opened 9 years ago
Closed 9 years ago
JitcodeGlobalEntry for baseline jitcode is not updated correctly
Categories
(Core :: JavaScript: GC, defect)
Core
JavaScript: GC
Tracking
()
RESOLVED
FIXED
mozilla49
Tracking | Status | |
---|---|---|
firefox47 | --- | unaffected |
firefox48 | + | fixed |
firefox49 | + | fixed |
firefox-esr45 | --- | unaffected |
People
(Reporter: jonco, Assigned: jonco)
References
Details
(Keywords: csectype-uaf, sec-high)
Attachments
(2 files, 1 obsolete file)
(deleted),
patch
|
jonco
:
review+
abillings
:
sec-approval+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
jonco
:
review+
abillings
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
JitcodeGlobalTable lookup methods return a copy of the JitcodeGlobalEntry, so when these are marked then any moved pointers will not be updated. As far as I can tell this only affects the script pointer in BaselineEntry.
Assignee | ||
Comment 1•9 years ago
|
||
I changed JitcodeGlobalTable::lookupInfallible to return a reference to the entry rather than copying it, and updated callers.
Attachment #8746060 -
Flags: review?(jdemooij)
Comment 2•9 years ago
|
||
Comment on attachment 8746060 [details] [diff] [review]
bug1268083-jitcode-map
Review of attachment 8746060 [details] [diff] [review]:
-----------------------------------------------------------------
Ugh, good catch.
::: js/src/jit/JitcodeMap.h
@@ +1029,5 @@
> return skiplistSize_ == 0;
> }
>
> bool lookup(void* ptr, JitcodeGlobalEntry* result, JSRuntime* rt);
> bool lookupForSampler(void* ptr, JitcodeGlobalEntry* result, JSRuntime* rt,
Should we change these two methods to return a pointer (null on failure)? Or rename to lookupCopy?
Attachment #8746060 -
Flags: review?(jdemooij) → review+
Assignee | ||
Comment 3•9 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #2)
> Should we change these two methods to return a pointer (null on failure)? Or
> rename to lookupCopy?
Good call, I'll try making them return pointers.
Assignee | ||
Comment 4•9 years ago
|
||
Kannan, in this code in ProfilingFrameIterator::getPhysicalFrameAndEntry:
jit::JitcodeGlobalTable* table = rt_->jitRuntime()->getJitcodeGlobalTable();
if (hasSampleBufferGen())
table->lookupForSampler(returnAddr, entry, rt_, sampleBufferGen_);
else
table->lookupInfallible(returnAddr, entry, rt_);
I just wanted to check, is lookupForSampler infallible too? It's assumed to succeed here.
Flags: needinfo?(kvijayan)
Updated•9 years ago
|
Keywords: csectype-uaf,
sec-high
Updated•9 years ago
|
status-firefox49:
--- → affected
Assignee | ||
Comment 5•9 years ago
|
||
This has been an issue since we since we started moving scripts in bug 1122579.
Blocks: CompactingGC
Assignee | ||
Comment 6•9 years ago
|
||
Updated patch with review comments.
Attachment #8746060 -
Attachment is obsolete: true
Attachment #8749118 -
Flags: review+
Assignee | ||
Updated•9 years ago
|
status-firefox48:
--- → affected
Assignee | ||
Comment 7•9 years ago
|
||
Comment on attachment 8749118 [details] [diff] [review]
bug1268083-jitcode-map v2
[Security approval request comment]
How easily could an exploit be constructed based on the patch? Very difficult. I haven't see a crash due to this but it is possible.
Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem? No.
Which older supported branches are affected by this flaw? 48 is affected.
If not all supported branches, which bug introduced the flaw? Bug 1122579.
Do you have backports for the affected branches? If not, how different, hard to create, and risky will they be? The same patch should apply.
How likely is this patch to cause regressions; how much testing does it need? Unlikely to cause regressions.
Attachment #8749118 -
Flags: sec-approval?
Comment 8•9 years ago
|
||
sec-approval+ for trunk. We'll want a patch for aurora as well.
status-firefox47:
--- → unaffected
status-firefox-esr45:
--- → unaffected
tracking-firefox48:
--- → +
tracking-firefox49:
--- → +
Updated•9 years ago
|
Attachment #8749118 -
Flags: sec-approval? → sec-approval+
Target Milestone: --- → mozilla49
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Updated•9 years ago
|
Group: javascript-core-security → core-security-release
Assignee | ||
Comment 10•9 years ago
|
||
Approval Request Comment
[Feature/regressing bug #]: Bug 1259180
[User impact if declined]: Possible crash / vulnerability.
[Describe test coverage new/current, TreeHerder]: On m-c since 6th May.
[Risks and why]: Low.
[String/UUID change made/needed]: None.
Attachment #8751212 -
Flags: review+
Attachment #8751212 -
Flags: approval-mozilla-aurora?
Assignee | ||
Updated•9 years ago
|
Updated•9 years ago
|
Attachment #8751212 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 11•9 years ago
|
||
Updated•8 years ago
|
Group: core-security-release
Updated•5 years ago
|
Flags: needinfo?(kvijayan)
You need to log in
before you can comment on or make changes to this bug.
Description
•