Closed
Bug 472502
Opened 16 years ago
Closed 16 years ago
"ASSERTION: Missing a script blocker" loading 400790-1.xul
Categories
(Core :: XUL, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: jruderman, Assigned: smaug)
References
Details
(5 keywords, Whiteboard: [sg:investigate] post 1.8-branch)
Attachments
(2 files)
(deleted),
application/vnd.mozilla.xul+xml
|
Details | |
(deleted),
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
dveditz
:
approval1.9.0.7+
|
Details | Diff | Splinter Review |
layout/xul/base/src/grid/crashtests/400790-1.xul triggers
###!!! ASSERTION: Missing a script blocker!: '!nsContentUtils::IsSafeToRunScript()', file /Users/jruderman/central/content/xul/content/src/nsXULElement.cpp, line 853
Looks like this assertion was added in bug 436965.
Flags: in-testsuite+
Assignee | ||
Comment 1•16 years ago
|
||
Hmm, I put the assertion to wrong place. Native anon content (not iframes or frames) is bound during frame construction. Patch coming.
Assignee: nobody → Olli.Pettay
But shouldn't there always be a scriptblocker while BindToTree is called? When we're binding native anon content we're inside frameconstruction, and when we're binding normal content we're inside BeginUpdate/EndUpdate.
More to the point, while we're inside BindToTree we're in an inconsistent state and it would be unsafe to run script.
Assignee | ||
Comment 3•16 years ago
|
||
Indeed. Idiot me.
Assignee | ||
Comment 4•16 years ago
|
||
Ah, fun. nsListBoxBodyFrame does its own frame creation in nsListBoxBodyFrame::GetNextItemBox
Assignee | ||
Comment 5•16 years ago
|
||
This is the interesting part of the stack.
#21 0x00002aaab0ba59ec in nsCSSFrameConstructor::CreateListBoxContent (this=0xa4b540, aPresContext=<value optimized out>,
aParentFrame=0x1d3daf8, aPrevFrame=0x21d5ee0, aChild=0x1f3a3b0, aNewFrame=0x7fff70884220, aIsAppend=0, aIsScrollbar=0,
aFrameState=0x0) at /home/smaug/mozilla/mozilla_cvs/hg/mozilla/layout/base/nsCSSFrameConstructor.cpp:12262
#22 0x00002aaab0d6a4e2 in nsListBoxBodyFrame::GetNextItemBox (this=0x1d3daf8, aBox=0x21d5ee0, aOffset=<value optimized out>,
aCreated=0x7fff7088427c) at /home/smaug/mozilla/mozilla_cvs/hg/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp:1236
#23 0x00002aaab0d6a645 in nsListBoxBodyFrame::CreateRows (this=0x1d3daf8)
at /home/smaug/mozilla/mozilla_cvs/hg/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp:1074
#24 0x00002aaab0d6aa2a in nsListBoxBodyFrame::ReflowFinished (this=0x3a7f)
at /home/smaug/mozilla/mozilla_cvs/hg/mozilla/layout/xul/base/src/nsListBoxBodyFrame.cpp:476
#25 0x00002aaab0be9a31 in PresShell::HandlePostedReflowCallbacks (this=0x31a9680)
at /home/smaug/mozilla/mozilla_cvs/hg/mozilla/layout/base/nsPresShell.cpp:4381
#26 0x00002aaab0bf3765 in PresShell::DidDoReflow (this=0x31a9680)
at /home/smaug/mozilla/mozilla_cvs/hg/mozilla/layout/base/nsPresShell.cpp:6181
#27 0x00002aaab0bf6d84 in PresShell::ProcessReflowCommands (this=0x31a9680, aInterruptible=1)
at /home/smaug/mozilla/mozilla_cvs/hg/mozilla/layout/base/nsPresShell.cpp:6369
#28 0x00002aaab0bf6f34 in PresShell::DoFlushPendingNotifications (this=0x31a9680, aType=Flush_Layout, aInterruptibleReflow=1)
at /home/smaug/mozilla/mozilla_cvs/hg/mozilla/layout/base/nsPresShell.cpp:4487
So nsCSSFrameConstructor::CreateListBoxContent creating frames results in XBL bindings being attached which causes BindToTree to be called? (would be good with the rest of the stack until BindToTree).
Does this mean that if you stick a <script> or <iframe> inside a binding and bind it to an element inside a listbox you can run script from nsListBoxBodyFrame::GetNextItemBox?
If so, should we mark this bug security sensitive? I suspect so.
Is the right place to add a scriptblocker somewhere in frame 25-27 in comment 5?
Assignee | ||
Comment 7•16 years ago
|
||
Marking security sensitive for now, although I think or hope this doesn't need to be.
The bound element is something in scrollbar, which is in native anon.
I'll look at this tomorrow, if I just have time.
Group: core-security
Assignee | ||
Comment 8•16 years ago
|
||
This is the best place for a blocker I can think of.
Assignee | ||
Updated•16 years ago
|
Attachment #355969 -
Flags: superreview?(jonas)
Attachment #355969 -
Flags: review?(jonas)
Comment on attachment 355969 [details] [diff] [review]
patch
I bz really is a better person to review this. My concern here is if the caller of this function is prepared for scripts executing before the function returns.
Attachment #355969 -
Flags: superreview?(jonas)
Attachment #355969 -
Flags: superreview?(bzbarsky)
Attachment #355969 -
Flags: review?(jonas)
Attachment #355969 -
Flags: review?(bzbarsky)
Comment 10•16 years ago
|
||
It's not quite. We should probably avoid doing the flush in HandlePostedReflowCallbacks if we've had Destroy() called, at the very least.
We might also want to hold a deathgrip there.
Assignee | ||
Comment 11•16 years ago
|
||
Er, we kind of expect that scripts may run in ReflowFinished. If that is not
the case, caller should be fixed.
Comment 12•16 years ago
|
||
> Er, we kind of expect that scripts may run in ReflowFinished.
That's what I thought, but if ReflowFinished returns true, we'll call FlushPendingNotifications in the caller. If the presshell got destroyed by the script, mViewManager will be null. I guess we assert-but-don't-crash in that case, ok.
It's still probably a good idea to add some safety to the caller, per above, but I'm ok with a followup bug for that.
Updated•16 years ago
|
Attachment #355969 -
Flags: superreview?(bzbarsky)
Attachment #355969 -
Flags: superreview+
Attachment #355969 -
Flags: review?(bzbarsky)
Attachment #355969 -
Flags: review+
Reporter | ||
Updated•16 years ago
|
Whiteboard: [sg:investigate]
Comment 13•16 years ago
|
||
Did this turn out to be a security problem and need to land on the 1.9.0 branch if we take bug 436965? Please adjust sg:investigate to the appropriate severity.
Flags: wanted1.9.0.x+
Flags: blocking1.9.0.7+
Assignee | ||
Comment 14•16 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/bcb61d06a3d4
I'll investigate if this is a real security problem.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•16 years ago
|
Attachment #355969 -
Flags: approval1.9.1?
Assignee | ||
Comment 15•16 years ago
|
||
Any chance to get the 1.9.1 approval?
Assignee | ||
Comment 16•16 years ago
|
||
The patch applies to 1.9.0 too.
Assignee | ||
Updated•16 years ago
|
Attachment #355969 -
Flags: approval1.9.0.7?
Comment 17•16 years ago
|
||
Per comment 17, shouldn't this just be nominated for blocking, not for just for approval?
Assignee | ||
Updated•16 years ago
|
Flags: blocking1.9.1?
Flags: blocking1.9.1? → blocking1.9.1+
Assignee | ||
Comment 18•16 years ago
|
||
Assignee | ||
Updated•16 years ago
|
Attachment #355969 -
Flags: approval1.9.1?
Assignee | ||
Updated•16 years ago
|
Keywords: fixed1.9.1
Updated•16 years ago
|
Attachment #355969 -
Flags: approval1.9.0.7? → approval1.9.0.7+
Comment 19•16 years ago
|
||
Comment on attachment 355969 [details] [diff] [review]
patch
Approved for 1.9.0.7, a=dveditz for release-drivers.
Assignee | ||
Updated•16 years ago
|
Keywords: fixed1.9.0.7
Comment 20•16 years ago
|
||
Doesn't seem to be needed in 1.8. Unhiding comment 6 now that the bug itself is private.
Flags: wanted1.8.1.x-
Whiteboard: [sg:investigate] → [sg:investigate] post 1.8-branch
Comment 21•16 years ago
|
||
The reftest in comment 0 passes now? Is there any particular way to verify this fix on 1.9.0.7 beyond this? Would the reftest catch this (I assume so)?
Assignee | ||
Comment 22•16 years ago
|
||
Use a debug build and make sure that you don't get that assertion when running the test.
Comment 23•16 years ago
|
||
Tomcat, can you do this? You're the one person in QA who builds all of the debug builds.
Comment 24•16 years ago
|
||
(In reply to comment #24)
> Tomcat, can you do this? You're the one person in QA who builds all of the
> debug builds.
also done :)
verified 1.9.0.7 using Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.7pre) Gecko/2009021407 Firefox/3.0.7pre - don't see this assertion in the debug build
Keywords: fixed1.9.0.7 → verified1.9.0.7
Updated•16 years ago
|
Group: core-security
Comment 25•15 years ago
|
||
verified FIXED (no assertion via attached testcase) on debug builds:
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1pre) Gecko/20090608 Shiretoko/3.5pre ID:20090608122057
and
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090608 Minefield/3.6a1pre ID:20090608122028
Status: RESOLVED → VERIFIED
Keywords: fixed1.9.1 → verified1.9.1
You need to log in
before you can comment on or make changes to this bug.
Description
•