Closed Bug 941766 Opened 11 years ago Closed 11 years ago

Fix an exact rooting hazard in NPAPI

Categories

(Core Graveyard :: Plug-ins, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla28

People

(Reporter: terrence, Assigned: terrence)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file, 1 obsolete file)

Attached patch suppress_createobject-v0.diff (obsolete) — 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 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 :(
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.
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)
Summary: Suppress an exact rooting hazard false positive in _createobject → Fix an exact rooting hazard in NPAPI
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)
Attachment #8343919 - Flags: review?(jschoenick) → review+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: