Closed
Bug 941766
Opened 11 years ago
Closed 11 years ago
Fix an exact rooting hazard in NPAPI
Categories
(Core Graveyard :: Plug-ins, defect)
Core Graveyard
Plug-ins
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla28
People
(Reporter: terrence, Assigned: terrence)
References
Details
(Whiteboard: [qa-])
Attachments
(1 file, 1 obsolete file)
1.65 KB,
patch
|
johns
:
review+
|
Details | Diff | Splinter Review |
The allocation happens through a field call that the analysis cannot see though. Asserting that no gc can happen will let the analysis know it is safe.
Attachment #8336211 -
Flags: review?(jschoenick)
Comment 1•11 years ago
|
||
Comment on attachment 8336211 [details] [diff] [review]
suppress_createobject-v0.diff
Review of attachment 8336211 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/plugins/base/nsNPAPIPlugin.cpp
@@ +1371,5 @@
>
> NPObject *npobj;
>
> if (aClass->allocate) {
> + JS::AutoAssertNoGC nogc; // The JS GC hazard analysis cannot see through this field call.
Does this inhibit GC or merely assert that we cannot GC here? As far as I'm aware, there's nothing stopping a particularly insane plugin from calling arbitrary JS inside a custom allocator :(
Comment 2•11 years ago
|
||
yeah, we shouldn't assume that ->allocate is safe, especially for Java. Once Java is OOPP then we probably can assume that all plugins are OOPP and this would become safe.
Assignee | ||
Comment 3•11 years ago
|
||
Comment on attachment 8336211 [details] [diff] [review]
suppress_createobject-v0.diff
You are correct: if that can run arbitrary code then we'll need to exactly root here. Eww.
I'll draft a patch to do that instead.
Attachment #8336211 -
Attachment is obsolete: true
Attachment #8336211 -
Flags: review?(jschoenick)
Assignee | ||
Updated•11 years ago
|
Summary: Suppress an exact rooting hazard false positive in _createobject → Fix an exact rooting hazard in NPAPI
Assignee | ||
Comment 4•11 years ago
|
||
This turned out to be pretty simple. Since |key| is just a trivial typey wrapper, we can just re-generate it from the rooted object after the potential GC.
Attachment #8343919 -
Flags: review?(jschoenick)
Updated•11 years ago
|
Attachment #8343919 -
Flags: review?(jschoenick) → review+
Assignee | ||
Comment 5•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Updated•11 years ago
|
Whiteboard: [qa-]
Updated•3 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•