Closed
Bug 327712
Opened 19 years ago
Closed 19 years ago
nsXBLProtoImplProperty::InstallMember doesn't root correctly
Categories
(Core :: XBL, defect)
Core
XBL
Tracking
()
RESOLVED
FIXED
People
(Reporter: dbaron, Assigned: dbaron)
References
Details
(Keywords: fixed1.8.1, verified1.8.0.4, Whiteboard: [sg:critical?][patch])
Attachments
(1 file, 1 obsolete file)
5.66 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
bzbarsky
:
approval-branch-1.8.1+
dveditz
:
approval1.8.0.4+
|
Details | Diff | Splinter Review |
nsXBLProtoImplProperty::InstallMember doesn't root correctly because it doesn't give its temporary variable a name! (LXR says this is the only use of nsAutoGCRoot with this problem.)
Assignee | ||
Comment 1•19 years ago
|
||
The first chunk is the important one, the rest is cleanup that I've had in my tree for ages (the call used to require a cx argument, it no loner does).
Attachment #212308 -
Flags: superreview?(bzbarsky)
Attachment #212308 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•19 years ago
|
Whiteboard: [patch]
Assignee | ||
Comment 2•19 years ago
|
||
Actually, we need to root the setter too, because DefineUCProperty can cause GC:
js_GC (/builds/trunk/mozilla/js/src/jsgc.c:1947)
js_NewGCThing (/builds/trunk/mozilla/js/src/jsgc.c:635)
AllocSlots (/builds/trunk/mozilla/js/src/jsobj.c:1925)
js_NewObject (/builds/trunk/mozilla/js/src/jsobj.c:2052)
js_CloneFunctionObject (/builds/trunk/mozilla/js/src/jsfun.c:2070)
JS_CloneFunctionObject (/builds/trunk/mozilla/js/src/jsapi.c:3414)
xpc_CloneJSFunction(XPCCallContext&, JSObject*, JSObject*) (/builds/trunk/mozilla/js/src/xpconnect/src/xpcwrappednativeinfo.cpp:56)
DefinePropertyIfFound (/builds/trunk/mozilla/js/src/xpconnect/src/xpcwrappednativejsops.cpp:453)
XPC_WN_ModsAllowed_Proto_Resolve (/builds/trunk/mozilla/js/src/xpconnect/src/xpcwrappednativejsops.cpp:1574)
js_LookupPropertyWithFlags (/builds/trunk/mozilla/js/src/jsobj.c:2801)
js_LookupProperty (/builds/trunk/mozilla/js/src/jsobj.c:2660)
js_DefineNativeProperty (/builds/trunk/mozilla/js/src/jsobj.c:2524)
js_DefineProperty (/builds/trunk/mozilla/js/src/jsobj.c:2469)
DefineUCProperty (/builds/trunk/mozilla/js/src/jsapi.c:2381)
Assignee | ||
Comment 3•19 years ago
|
||
Attachment #212308 -
Attachment is obsolete: true
Attachment #212309 -
Flags: superreview?(bzbarsky)
Attachment #212309 -
Flags: review?(bzbarsky)
Attachment #212308 -
Flags: superreview?(bzbarsky)
Attachment #212308 -
Flags: review?(bzbarsky)
![]() |
||
Comment 4•19 years ago
|
||
Comment on attachment 212309 [details] [diff] [review]
patch
r+sr=bzbarsky, but we need similar changes to root newly-cloned function objects across JS_DefineUCProperty in nsXBLProtoImplMethod::InstallMember and the code added in bug 307040.
It looks like thanks to the wonders of XPConnect, Brendan's bug 299205 comment 10 is not quite right. :(
We probably want this on both 1.8 branches.
Attachment #212309 -
Flags: superreview?(bzbarsky)
Attachment #212309 -
Flags: superreview+
Attachment #212309 -
Flags: review?(bzbarsky)
Attachment #212309 -
Flags: review+
Assignee | ||
Comment 5•19 years ago
|
||
Fix checked in to trunk.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 6•19 years ago
|
||
Filed comment 4 as bug 328007.
Assignee | ||
Updated•19 years ago
|
Attachment #212309 -
Flags: approval1.8.0.3?
Attachment #212309 -
Flags: approval-branch-1.8.1?(bzbarsky)
![]() |
||
Updated•19 years ago
|
Attachment #212309 -
Flags: approval-branch-1.8.1?(bzbarsky) → approval-branch-1.8.1+
Comment 8•19 years ago
|
||
Can we get some info about how this affect people in the wild? How will this benefit the users? We need this benefit before we can approve the patch for 1.8.0.3.
Updated•19 years ago
|
Flags: blocking1.8.0.3+
Comment 9•19 years ago
|
||
Since some null checks are being removed by this patch, we'd like a little more clarity w.r.t. risk before accepting this patch. Can someone please address Tim's question (comment #8). Thanks!
![]() |
||
Comment 10•19 years ago
|
||
> Since some null checks are being removed by this patch,
The null checks being removed were holdovers from back when we actually used the |cx| object there (to root stuff). We don't anymore, so it's not an issue whether cx is null (not that it ever can be in this case).
As for comment 8, this just makes sure we don't access deleted objects by keeping them alive while we're working with them. The effect should be fewer random exploitable deleted-memory-access crashes and nothing else.
Assignee | ||
Updated•19 years ago
|
Group: security
Assignee | ||
Comment 11•19 years ago
|
||
The null-check removals were just cleanup -- very low risk cleanup, though. But I could easily skip that part of the patch for a 1.8.0 branch landing.
Comment 12•19 years ago
|
||
For crying out loud...
Read http://lxr.mozilla.org/mozilla/source/content/base/src/nsContentUtils.cpp#2552 and note that there is no dependency on a (JSContext *) cx cast from any aContext that is *not* passed to nsContentUtils::AddJSGCRoot.
The whole GetNativeContext call, assignment to cx, and test of cx are useless. The patch should be taken in full, fiddling to remove these null check removals is a waste of time and a minor but non-zero merge hazard.
/be
Comment 13•19 years ago
|
||
Comment on attachment 212309 [details] [diff] [review]
patch
approved for 1.8.0 branch, a=dveditz for drivers
Attachment #212309 -
Flags: approval1.8.0.3? → approval1.8.0.3+
Comment 15•19 years ago
|
||
v.fixed on 1.8.0 branch: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8.0.2) Gecko/20060420 Firefox/1.5.0.2, based on code inspection and brendan's comments.
Keywords: fixed1.8.0.3 → verified1.8.0.3
Updated•19 years ago
|
Whiteboard: [patch] → [sg:critical?][patch]
Updated•19 years ago
|
Flags: blocking1.7.14?
Flags: blocking-aviary1.0.9?
Updated•19 years ago
|
Group: security
You need to log in
before you can comment on or make changes to this bug.
Description
•